home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cocktail / puma.lha / puma / m2c / Mod.c < prev    next >
C/C++ Source or Header  |  1992-09-25  |  62KB  |  2,320 lines

  1. #include "SYSTEM_.h"
  2.  
  3. #ifndef DEFINITION_System
  4. #include "System.h"
  5. #endif
  6.  
  7. #ifndef DEFINITION_IO
  8. #include "IO.h"
  9. #endif
  10.  
  11. #ifndef DEFINITION_Tree
  12. #include "Tree.h"
  13. #endif
  14.  
  15. #ifndef DEFINITION_Positions
  16. #include "Positions.h"
  17. #endif
  18.  
  19. #ifndef DEFINITION_IO
  20. #include "IO.h"
  21. #endif
  22.  
  23. #ifndef DEFINITION_StringMem
  24. #include "StringMem.h"
  25. #endif
  26.  
  27. #ifndef DEFINITION_Idents
  28. #include "Idents.h"
  29. #endif
  30.  
  31. #ifndef DEFINITION_Texts
  32. #include "Texts.h"
  33. #endif
  34.  
  35. #ifndef DEFINITION_Sets
  36. #include "Sets.h"
  37. #endif
  38.  
  39. #ifndef DEFINITION_Semantics
  40. #include "Semantics.h"
  41. #endif
  42.  
  43. #ifndef DEFINITION_Optimize
  44. #include "Optimize.h"
  45. #endif
  46.  
  47. #ifndef DEFINITION_Tree
  48. #include "Tree.h"
  49. #endif
  50.  
  51. #ifndef DEFINITION_Mod
  52. #include "Mod.h"
  53. #endif
  54.  
  55. IO_tFile Mod_yyf;
  56. PROC Mod_Exit;
  57.  
  58. #define kProcedure    0
  59. #define kFunction    1
  60. #define kPredicate    2
  61. static unsigned char RoutineKind;
  62. static CARDINAL i, j;
  63. static INTEGER ListCount;
  64. static Tree_tTree rule, TheClass, InFormals, OutFormals, ReturnFormals, Decls;
  65. static Idents_tIdent TheName;
  66. static BOOLEAN TemposDone;
  67. static void WriteLine ARGS((Positions_tPosition Line));
  68. static void Match ARGS((Tree_tTree t, Tree_tTree Formals));
  69. static void MatchExprs ARGS((Tree_tTree t));
  70. static void MatchExpr ARGS((Tree_tTree t));
  71. static void AssignTempos ARGS((Tree_tTree t));
  72. static void AssignTempo ARGS((Tree_tTree t));
  73. static void AssignFormals ARGS((Tree_tTree t, Tree_tTree Formals));
  74. static void AssignFormal ARGS((Tree_tTree t, Tree_tTree Formals));
  75. static void BeginFormals ARGS((Tree_tTree Formals));
  76. static INTEGER ConsPatterns ARGS((Tree_tTree t, INTEGER ListCount));
  77. static INTEGER ConsTempos ARGS((Tree_tTree t, INTEGER ListCount));
  78. static INTEGER Expressions ARGS((Tree_tTree t, INTEGER ListCount));
  79. static void Expression ARGS((Tree_tTree t));
  80. static void Tg2 ARGS((Tree_tTree t, Tree_tTree Formals));
  81. static void yyAbort ARGS((CHAR yyFunction[], LONGCARD ));
  82. static BOOLEAN yyIsEqual ARGS((BYTE yya[], LONGCARD , BYTE yyb[], LONGCARD ));
  83. struct S_3 {
  84.     union {
  85.         char dummy;
  86.     } U_1;
  87. };
  88. struct S_4 {
  89.     union {
  90.         char dummy;
  91.     } U_1;
  92. };
  93. struct S_5 {
  94.     union {
  95.         struct {
  96.             struct S_6 {
  97.                 Tree_tTree Var;
  98.             } yyR14;
  99.         } V_1;
  100.     } U_1;
  101. };
  102. static void Declare ARGS((Tree_tTree t));
  103. struct S_7 {
  104.     union {
  105.         struct {
  106.             struct S_8 {
  107.                 Tree_tTree Var;
  108.             } yyR2;
  109.         } V_1;
  110.     } U_1;
  111. };
  112. static void Tg1 ARGS((Tree_tTree t));
  113. struct S_9 {
  114.     union {
  115.         char dummy;
  116.     } U_1;
  117. };
  118. static void Tg3 ARGS((Tree_tTree t));
  119. struct S_10 {
  120.     union {
  121.         char dummy;
  122.     } U_1;
  123. };
  124. static void CommonTestElim2 ARGS((Tree_tTree OneTest, Tree_tTree yyP1));
  125. struct S_11 {
  126.     union {
  127.         char dummy;
  128.     } U_1;
  129. };
  130. static void CommonTestElim ARGS((Tree_tTree t));
  131. struct S_12 {
  132.     union {
  133.         char dummy;
  134.     } U_1;
  135. };
  136. static void Case ARGS((Tree_tTree t));
  137. struct S_13 {
  138.     union {
  139.         struct {
  140.             struct S_14 {
  141.                 CARDINAL n;
  142.             } yyR1;
  143.         } V_1;
  144.     } U_1;
  145. };
  146. static void yyExit ARGS(());
  147.  
  148.  
  149. static void WriteLine
  150. # ifdef __STDC__
  151. (Positions_tPosition Line)
  152. # else
  153. (Line)
  154. Positions_tPosition Line;
  155. # endif
  156. {
  157.   if (Line.Line != 0) {
  158.     IO_WriteS(Tree_f, (STRING)"(* line ", 8L);
  159.     Tree_WN((LONGINT)Line.Line);
  160.     IO_WriteS(Tree_f, (STRING)" \"", 2L);
  161.     IO_WriteS(Tree_f, Tree_SourceFile.A, 256L);
  162.     IO_WriteS(Tree_f, (STRING)"\" *)", 4L);
  163.     IO_WriteNl(Tree_f);
  164.   }
  165. }
  166.  
  167. static void Match
  168. # ifdef __STDC__
  169. (Tree_tTree t, Tree_tTree Formals)
  170. # else
  171. (t, Formals)
  172. Tree_tTree t, Formals;
  173. # endif
  174. {
  175.   Idents_tIdent TreeName;
  176.   Tree_tTree Pattern;
  177.  
  178.   if (t->U_1.V_1.Kind == Tree_NoPattern || Formals->U_1.V_1.Kind != Tree_Formal) {
  179.     return;
  180.   }
  181.   Pattern = t->U_1.V_45.OnePattern.Pattern;
  182.   switch (Pattern->U_1.V_1.Kind) {
  183.   case Tree_Decompose:;
  184.     {
  185.       register Tree_yDecompose *W_1 = &Pattern->U_1.V_50.Decompose;
  186.  
  187.       TreeName = W_1->Object->U_1.V_5.Class.TypeDesc->U_1.V_89.NodeTypes.TreeName->U_1.V_29.TreeName.Name;
  188.       if (Formals->U_1.V_86.Formal.TypeDesc->U_1.V_1.Kind == Tree_UserType || Sets_IsNotEqual(W_1->Object->U_1.V_5.Class.TypeDesc->U_1.V_89.NodeTypes.Types, Formals->U_1.V_86.Formal.TypeDesc->U_1.V_89.NodeTypes.Types)) {
  189.         if (W_1->Object->U_1.V_5.Class.Extensions->U_1.V_1.Kind == Tree_NoClass) {
  190.           IO_WriteS(Tree_f, (STRING)"      IF (", 10L);
  191.           Mod_ImplMod(W_1->Path);
  192.           IO_WriteS(Tree_f, (STRING)"^.Kind # ", 9L);
  193.         } else {
  194.           IO_WriteS(Tree_f, (STRING)"      IF NOT ", 13L);
  195.           Tree_WI(TreeName);
  196.           IO_WriteS(Tree_f, (STRING)".IsType (", 9L);
  197.           Mod_ImplMod(W_1->Path);
  198.           IO_WriteS(Tree_f, (STRING)", ", 2L);
  199.         }
  200.         Tree_WI(TreeName);
  201.         IO_WriteS(Tree_f, (STRING)".", 1L);
  202.         Tree_WI(W_1->Object->U_1.V_5.Class.Name);
  203.         IO_WriteS(Tree_f, (STRING)") THEN EXIT; END;", 17L);
  204.         IO_WriteNl(Tree_f);
  205.       }
  206.       Match(W_1->Patterns, W_1->Object->U_1.V_5.Class.Formals);
  207.     }
  208.     break;
  209.   case Tree_VarDef:;
  210.     {
  211.       register Tree_yVarDef *W_2 = &Pattern->U_1.V_51.VarDef;
  212.  
  213.       if (W_2->Object != Tree_NoTree) {
  214.         {
  215.           register Tree_yFormal *W_3 = &W_2->Object->U_1.V_86.Formal;
  216.  
  217.           IO_WriteS(Tree_f, (STRING)"      IF NOT (equal", 19L);
  218.           Mod_ImplMod(W_3->TypeDesc);
  219.           IO_WriteS(Tree_f, (STRING)" (", 2L);
  220.           Mod_ImplMod(W_3->Path);
  221.           IO_WriteS(Tree_f, (STRING)", ", 2L);
  222.           Mod_ImplMod(Pattern->U_1.V_51.VarDef.Path);
  223.           IO_WriteS(Tree_f, (STRING)")) THEN EXIT; END;", 18L);
  224.           IO_WriteNl(Tree_f);
  225.         }
  226.       }
  227.     }
  228.     break;
  229.   case Tree_NilTest:;
  230.     IO_WriteS(Tree_f, (STRING)"      IF ", 9L);
  231.     Mod_ImplMod(Pattern->U_1.V_52.NilTest.Path);
  232.     IO_WriteS(Tree_f, (STRING)" # NIL THEN EXIT; END;", 22L);
  233.     IO_WriteNl(Tree_f);
  234.     break;
  235.   case Tree_DontCare1:;
  236.     break;
  237.   case Tree_DontCare:;
  238.     return;
  239.     break;
  240.   case Tree_Value:;
  241.     {
  242.       register Tree_yValue *W_4 = &Pattern->U_1.V_55.Value;
  243.  
  244.       AssignTempo(W_4->Expr);
  245.       IO_WriteS(Tree_f, (STRING)"      IF NOT (equal", 19L);
  246.       Mod_ImplMod(Formals->U_1.V_86.Formal.TypeDesc);
  247.       IO_WriteS(Tree_f, (STRING)" (", 2L);
  248.       Mod_ImplMod(W_4->Path);
  249.       IO_WriteS(Tree_f, (STRING)", ", 2L);
  250.       Expression(W_4->Expr);
  251.       IO_WriteS(Tree_f, (STRING)")) THEN EXIT; END;", 18L);
  252.       IO_WriteNl(Tree_f);
  253.       MatchExpr(W_4->Expr);
  254.     }
  255.     break;
  256.   }
  257.   Match(t->U_1.V_45.OnePattern.Next, Formals->U_1.V_86.Formal.Next);
  258. }
  259.  
  260. static void MatchExprs
  261. # ifdef __STDC__
  262. (Tree_tTree t)
  263. # else
  264. (t)
  265. Tree_tTree t;
  266. # endif
  267. {
  268.   if (t->U_1.V_1.Kind == Tree_NoExpr) {
  269.     return;
  270.   }
  271.   if (t->U_1.V_58.OneExpr.Expr->U_1.V_1.Kind == Tree_DontCare) {
  272.     return;
  273.   }
  274.   MatchExpr(t->U_1.V_58.OneExpr.Expr);
  275.   MatchExprs(t->U_1.V_58.OneExpr.Next);
  276. }
  277.  
  278. static void MatchExpr
  279. # ifdef __STDC__
  280. (Tree_tTree t)
  281. # else
  282. (t)
  283. Tree_tTree t;
  284. # endif
  285. {
  286.   switch (t->U_1.V_1.Kind) {
  287.   case Tree_Compose:;
  288.     MatchExprs(t->U_1.V_61.Compose.Exprs);
  289.     break;
  290.   case Tree_VarUse:;
  291.     break;
  292.   case Tree_Nil:;
  293.     break;
  294.   case Tree_DontCare1:;
  295.     break;
  296.   case Tree_TargetExpr:;
  297.     break;
  298.   case Tree_StringExpr:;
  299.     break;
  300.   case Tree_AttrDesc:;
  301.     break;
  302.   case Tree_Call:;
  303.     {
  304.       register Tree_yCall *W_5 = &t->U_1.V_65.Call;
  305.  
  306.       MatchExpr(W_5->Expr);
  307.       MatchExprs(W_5->Exprs);
  308.       if (W_5->Object != Tree_NoTree) {
  309.         Match(W_5->Patterns, W_5->Object->U_1.V_32.Routine.OutForm);
  310.       }
  311.     }
  312.     break;
  313.   case Tree_Binary:;
  314.     {
  315.       register Tree_yBinary *W_6 = &t->U_1.V_66.Binary;
  316.  
  317.       MatchExpr(W_6->Lop);
  318.       MatchExpr(W_6->Rop);
  319.     }
  320.     break;
  321.   case Tree_PreOperator:;
  322.   case Tree_PostOperator:;
  323.     MatchExpr(t->U_1.V_67.PreOperator.Expr);
  324.     break;
  325.   case Tree_Index:;
  326.     MatchExpr(t->U_1.V_69.Index.Expr);
  327.     MatchExprs(t->U_1.V_69.Index.Exprs);
  328.     break;
  329.   case Tree_Parents:;
  330.     MatchExpr(t->U_1.V_70.Parents.Expr);
  331.     break;
  332.   }
  333. }
  334.  
  335. static void AssignTempos
  336. # ifdef __STDC__
  337. (Tree_tTree t)
  338. # else
  339. (t)
  340. Tree_tTree t;
  341. # endif
  342. {
  343.   if (t->U_1.V_1.Kind == Tree_NoExpr) {
  344.     return;
  345.   }
  346.   if (t->U_1.V_58.OneExpr.Expr->U_1.V_1.Kind == Tree_DontCare) {
  347.     return;
  348.   }
  349.   AssignTempo(t->U_1.V_58.OneExpr.Expr);
  350.   AssignTempos(t->U_1.V_58.OneExpr.Next);
  351. }
  352.  
  353. static void AssignTempo
  354. # ifdef __STDC__
  355. (Tree_tTree t)
  356. # else
  357. (t)
  358. Tree_tTree t;
  359. # endif
  360. {
  361.   Idents_tIdent TreeName;
  362.  
  363.   switch (t->U_1.V_1.Kind) {
  364.   case Tree_Compose:;
  365.     {
  366.       register Tree_yCompose *W_7 = &t->U_1.V_61.Compose;
  367.  
  368.       TreeName = W_7->Object->U_1.V_5.Class.TypeDesc->U_1.V_89.NodeTypes.TreeName->U_1.V_29.TreeName.Name;
  369.       IO_WriteS(Tree_f, (STRING)"      yyALLOC (", 15L);
  370.       Tree_WI(TreeName);
  371.       IO_WriteS(Tree_f, (STRING)",Make", 5L);
  372.       Tree_WI(TreeName);
  373.       IO_WriteS(Tree_f, (STRING)",", 1L);
  374.       Tree_WI(W_7->Tempo);
  375.       IO_WriteS(Tree_f, (STRING)",", 1L);
  376.       Tree_WI(W_7->Object->U_1.V_5.Class.Name);
  377.       IO_WriteS(Tree_f, (STRING)")", 1L);
  378.       IO_WriteNl(Tree_f);
  379.       if (W_7->Exprs->U_1.V_1.Kind == Tree_OneExpr && W_7->Exprs->U_1.V_58.OneExpr.Expr->U_1.V_1.Kind != Tree_DontCare) {
  380.         IO_WriteS(Tree_f, (STRING)"      WITH ", 11L);
  381.         Tree_WI(W_7->Tempo);
  382.         IO_WriteS(Tree_f, (STRING)"^.", 2L);
  383.         Tree_WI(W_7->Object->U_1.V_5.Class.Name);
  384.         IO_WriteS(Tree_f, (STRING)" DO", 3L);
  385.         IO_WriteNl(Tree_f);
  386.         AssignFormals(W_7->Exprs, W_7->Object->U_1.V_5.Class.Formals);
  387.         IO_WriteS(Tree_f, (STRING)"      END;", 10L);
  388.         IO_WriteNl(Tree_f);
  389.       }
  390.     }
  391.     break;
  392.   case Tree_VarUse:;
  393.     break;
  394.   case Tree_Nil:;
  395.     break;
  396.   case Tree_DontCare1:;
  397.     break;
  398.   case Tree_TargetExpr:;
  399.     break;
  400.   case Tree_StringExpr:;
  401.     break;
  402.   case Tree_AttrDesc:;
  403.     break;
  404.   case Tree_Call:;
  405.     {
  406.       register Tree_yCall *W_8 = &t->U_1.V_65.Call;
  407.  
  408.       AssignTempo(W_8->Expr);
  409.       AssignTempos(W_8->Exprs);
  410.     }
  411.     break;
  412.   case Tree_Binary:;
  413.     {
  414.       register Tree_yBinary *W_9 = &t->U_1.V_66.Binary;
  415.  
  416.       AssignTempo(W_9->Lop);
  417.       AssignTempo(W_9->Rop);
  418.     }
  419.     break;
  420.   case Tree_PreOperator:;
  421.   case Tree_PostOperator:;
  422.     AssignTempo(t->U_1.V_67.PreOperator.Expr);
  423.     break;
  424.   case Tree_Index:;
  425.     AssignTempo(t->U_1.V_69.Index.Expr);
  426.     AssignTempos(t->U_1.V_69.Index.Exprs);
  427.     break;
  428.   case Tree_Parents:;
  429.     AssignTempo(t->U_1.V_70.Parents.Expr);
  430.     break;
  431.   }
  432. }
  433.  
  434. static void AssignFormals
  435. # ifdef __STDC__
  436. (Tree_tTree t, Tree_tTree Formals)
  437. # else
  438. (t, Formals)
  439. Tree_tTree t, Formals;
  440. # endif
  441. {
  442.   if (t->U_1.V_1.Kind == Tree_NoExpr || Formals->U_1.V_1.Kind != Tree_Formal) {
  443.     return;
  444.   }
  445.   if (t->U_1.V_58.OneExpr.Expr->U_1.V_1.Kind == Tree_DontCare) {
  446.     BeginFormals(Formals);
  447.     return;
  448.   }
  449.   AssignFormal(t->U_1.V_58.OneExpr.Expr, Formals);
  450.   AssignFormals(t->U_1.V_58.OneExpr.Next, Formals->U_1.V_86.Formal.Next);
  451. }
  452.  
  453. static void AssignFormal
  454. # ifdef __STDC__
  455. (Tree_tTree t, Tree_tTree Formals)
  456. # else
  457. (t, Formals)
  458. Tree_tTree t, Formals;
  459. # endif
  460. {
  461.   Idents_tIdent TreeName;
  462.  
  463.   if (t->U_1.V_1.Kind == Tree_Compose) {
  464.     {
  465.       register Tree_yCompose *W_10 = &t->U_1.V_61.Compose;
  466.  
  467.       TreeName = W_10->Object->U_1.V_5.Class.TypeDesc->U_1.V_89.NodeTypes.TreeName->U_1.V_29.TreeName.Name;
  468.       IO_WriteS(Tree_f, (STRING)"      yyALLOC (", 15L);
  469.       Tree_WI(TreeName);
  470.       IO_WriteS(Tree_f, (STRING)",Make", 5L);
  471.       Tree_WI(TreeName);
  472.       IO_WriteS(Tree_f, (STRING)",", 1L);
  473.       Tree_WI(Formals->U_1.V_86.Formal.Name);
  474.       IO_WriteS(Tree_f, (STRING)",", 1L);
  475.       Tree_WI(W_10->Object->U_1.V_5.Class.Name);
  476.       IO_WriteS(Tree_f, (STRING)")", 1L);
  477.       IO_WriteNl(Tree_f);
  478.       if (W_10->Exprs->U_1.V_1.Kind == Tree_OneExpr && W_10->Exprs->U_1.V_58.OneExpr.Expr->U_1.V_1.Kind != Tree_DontCare) {
  479.         IO_WriteS(Tree_f, (STRING)"      WITH ", 11L);
  480.         Tree_WI(Formals->U_1.V_86.Formal.Name);
  481.         IO_WriteS(Tree_f, (STRING)"^.", 2L);
  482.         Tree_WI(W_10->Object->U_1.V_5.Class.Name);
  483.         IO_WriteS(Tree_f, (STRING)" DO", 3L);
  484.         IO_WriteNl(Tree_f);
  485.         AssignFormals(W_10->Exprs, W_10->Object->U_1.V_5.Class.Formals);
  486.         IO_WriteS(Tree_f, (STRING)"      END;", 10L);
  487.         IO_WriteNl(Tree_f);
  488.       }
  489.     }
  490.   } else {
  491.     AssignTempo(t);
  492.   }
  493.   switch (t->U_1.V_1.Kind) {
  494.   case Tree_VarUse:;
  495.   case Tree_Nil:;
  496.   case Tree_Call:;
  497.   case Tree_Binary:;
  498.   case Tree_PreOperator:;
  499.   case Tree_PostOperator:;
  500.   case Tree_Index:;
  501.   case Tree_Parents:;
  502.   case Tree_TargetExpr:;
  503.   case Tree_StringExpr:;
  504.   case Tree_AttrDesc:;
  505.     IO_WriteS(Tree_f, (STRING)"      ", 6L);
  506.     Tree_WI(Formals->U_1.V_86.Formal.Name);
  507.     IO_WriteS(Tree_f, (STRING)" := ", 4L);
  508.     Expression(t);
  509.     IO_WriteS(Tree_f, (STRING)";", 1L);
  510.     IO_WriteNl(Tree_f);
  511.     break;
  512.   case Tree_DontCare1:;
  513.     IO_WriteS(Tree_f, (STRING)"      begin", 11L);
  514.     Mod_ImplMod(Formals->U_1.V_86.Formal.TypeDesc);
  515.     IO_WriteS(Tree_f, (STRING)" (", 2L);
  516.     Tree_WI(Formals->U_1.V_86.Formal.Name);
  517.     IO_WriteS(Tree_f, (STRING)")", 1L);
  518.     IO_WriteNl(Tree_f);
  519.     break;
  520.   default :
  521.     break;
  522.   }
  523. }
  524.  
  525. static void BeginFormals
  526. # ifdef __STDC__
  527. (Tree_tTree Formals)
  528. # else
  529. (Formals)
  530. Tree_tTree Formals;
  531. # endif
  532. {
  533.   if (Formals->U_1.V_1.Kind == Tree_Formal) {
  534.     {
  535.       register Tree_yFormal *W_11 = &Formals->U_1.V_86.Formal;
  536.  
  537.       IO_WriteS(Tree_f, (STRING)"      begin", 11L);
  538.       Mod_ImplMod(W_11->TypeDesc);
  539.       IO_WriteS(Tree_f, (STRING)" (", 2L);
  540.       Tree_WI(W_11->Name);
  541.       IO_WriteS(Tree_f, (STRING)")", 1L);
  542.       IO_WriteNl(Tree_f);
  543.       BeginFormals(W_11->Next);
  544.     }
  545.   }
  546. }
  547.  
  548. static INTEGER ConsPatterns
  549. # ifdef __STDC__
  550. (Tree_tTree t, INTEGER ListCount)
  551. # else
  552. (t, ListCount)
  553. Tree_tTree t;
  554. INTEGER ListCount;
  555. # endif
  556. {
  557.   if (t->U_1.V_1.Kind == Tree_NoPattern) {
  558.     return ListCount;
  559.   }
  560.   {
  561.     register Tree_yOnePattern *W_12 = &t->U_1.V_45.OnePattern;
  562.  
  563.     if (W_12->Pattern->U_1.V_1.Kind == Tree_DontCare) {
  564.       return ConsTempos(W_12->Pattern->U_1.V_54.DontCare.Tempos, ListCount);
  565.     } else {
  566.       if (ListCount > 0) {
  567.         IO_WriteS(Tree_f, (STRING)", ", 2L);
  568.       }
  569.       Tree_WI(W_12->Pattern->U_1.V_49.Pattern.Tempo);
  570.       return ConsPatterns(W_12->Next, ListCount + 1);
  571.     }
  572.   }
  573. }
  574.  
  575. static INTEGER ConsTempos
  576. # ifdef __STDC__
  577. (Tree_tTree t, INTEGER ListCount)
  578. # else
  579. (t, ListCount)
  580. Tree_tTree t;
  581. INTEGER ListCount;
  582. # endif
  583. {
  584.   if (t->U_1.V_1.Kind == Tree_Formal) {
  585.     if (ListCount > 0) {
  586.       IO_WriteS(Tree_f, (STRING)", ", 2L);
  587.     }
  588.     Tree_WI(t->U_1.V_86.Formal.Name);
  589.     return ConsTempos(t->U_1.V_86.Formal.Next, ListCount + 1);
  590.   } else {
  591.     return ListCount;
  592.   }
  593. }
  594.  
  595. static INTEGER Expressions
  596. # ifdef __STDC__
  597. (Tree_tTree t, INTEGER ListCount)
  598. # else
  599. (t, ListCount)
  600. Tree_tTree t;
  601. INTEGER ListCount;
  602. # endif
  603. {
  604.   if (t->U_1.V_1.Kind == Tree_NoExpr) {
  605.     return ListCount;
  606.   }
  607.   {
  608.     register Tree_yOneExpr *W_13 = &t->U_1.V_58.OneExpr;
  609.  
  610.     if (W_13->Expr->U_1.V_1.Kind == Tree_DontCare) {
  611.       return ConsTempos(W_13->Expr->U_1.V_54.DontCare.Tempos, ListCount);
  612.     } else {
  613.       if (ListCount > 0) {
  614.         IO_WriteS(Tree_f, (STRING)", ", 2L);
  615.       }
  616.       Expression(W_13->Expr);
  617.       return Expressions(W_13->Next, ListCount + 1);
  618.     }
  619.   }
  620. }
  621.  
  622. static void Expression
  623. # ifdef __STDC__
  624. (Tree_tTree t)
  625. # else
  626. (t)
  627. Tree_tTree t;
  628. # endif
  629. {
  630.   switch (t->U_1.V_1.Kind) {
  631.   case Tree_Compose:;
  632.     Tree_WI(t->U_1.V_61.Compose.Tempo);
  633.     break;
  634.   case Tree_Nil:;
  635.     IO_WriteS(Tree_f, (STRING)"NIL", 3L);
  636.     break;
  637.   case Tree_VarUse:;
  638.     {
  639.       register Tree_yVarUse *W_14 = &t->U_1.V_62.VarUse;
  640.  
  641.       if (W_14->Object != Tree_NoTree) {
  642.         Mod_ImplMod(W_14->Object->U_1.V_86.Formal.Path);
  643.       } else {
  644.         Tree_WI(W_14->Name);
  645.       }
  646.     }
  647.     break;
  648.   case Tree_DontCare1:;
  649.     Tree_WI(t->U_1.V_53.DontCare1.Tempo);
  650.     break;
  651.   case Tree_Call:;
  652.     {
  653.       register Tree_yCall *W_15 = &t->U_1.V_65.Call;
  654.  
  655.       Expression(W_15->Expr);
  656.       IO_WriteS(Tree_f, (STRING)" (", 2L);
  657.       ListCount = Expressions(W_15->Exprs, 0L);
  658.       if (W_15->Object != Tree_NoTree) {
  659.         ListCount = ConsPatterns(W_15->Patterns, ListCount);
  660.       } else {
  661.         ListCount = Expressions(W_15->Patterns, ListCount);
  662.       }
  663.       IO_WriteS(Tree_f, (STRING)")", 1L);
  664.     }
  665.     break;
  666.   case Tree_Binary:;
  667.     {
  668.       register Tree_yBinary *W_16 = &t->U_1.V_66.Binary;
  669.  
  670.       Expression(W_16->Lop);
  671.       IO_WriteS(Tree_f, (STRING)" ", 1L);
  672.       Tree_WI(W_16->Operator);
  673.       IO_WriteS(Tree_f, (STRING)" ", 1L);
  674.       Expression(W_16->Rop);
  675.     }
  676.     break;
  677.   case Tree_PreOperator:;
  678.     Tree_WI(t->U_1.V_67.PreOperator.Operator);
  679.     IO_WriteS(Tree_f, (STRING)" ", 1L);
  680.     Expression(t->U_1.V_67.PreOperator.Expr);
  681.     break;
  682.   case Tree_PostOperator:;
  683.     Expression(t->U_1.V_68.PostOperator.Expr);
  684.     IO_WriteS(Tree_f, (STRING)" ", 1L);
  685.     Tree_WI(t->U_1.V_68.PostOperator.Operator);
  686.     break;
  687.   case Tree_Index:;
  688.     Expression(t->U_1.V_69.Index.Expr);
  689.     IO_WriteS(Tree_f, (STRING)" [", 2L);
  690.     ListCount = Expressions(t->U_1.V_69.Index.Exprs, 0L);
  691.     IO_WriteS(Tree_f, (STRING)"]", 1L);
  692.     break;
  693.   case Tree_Parents:;
  694.     IO_WriteS(Tree_f, (STRING)"(", 1L);
  695.     Expression(t->U_1.V_70.Parents.Expr);
  696.     IO_WriteS(Tree_f, (STRING)")", 1L);
  697.     break;
  698.   case Tree_TargetExpr:;
  699.     Mod_ImplMod(t->U_1.V_71.TargetExpr.Expr);
  700.     break;
  701.   case Tree_StringExpr:;
  702.     StringMem_WriteString(Tree_f, t->U_1.V_72.StringExpr.String);
  703.     break;
  704.   case Tree_AttrDesc:;
  705.     {
  706.       register Tree_yAttrDesc *W_17 = &t->U_1.V_63.AttrDesc;
  707.  
  708.       Mod_ImplMod(W_17->Object->U_1.V_86.Formal.Path);
  709.       IO_WriteS(Tree_f, (STRING)"^.", 2L);
  710.       Tree_WI(W_17->Type);
  711.       IO_WriteS(Tree_f, (STRING)".", 1L);
  712.       Tree_WI(W_17->Attribute);
  713.     }
  714.     break;
  715.   }
  716. }
  717.  
  718. static void Tg2
  719. # ifdef __STDC__
  720. (Tree_tTree t, Tree_tTree Formals)
  721. # else
  722. (t, Formals)
  723. Tree_tTree t, Formals;
  724. # endif
  725. {
  726.   if (t->U_1.V_1.Kind == Tree_NoPattern || Formals->U_1.V_1.Kind == Tree_NoFormal) {
  727.     return;
  728.   }
  729.   switch (t->U_1.V_45.OnePattern.Pattern->U_1.V_1.Kind) {
  730.   case Tree_Decompose:;
  731.     IO_WriteS(Tree_f, (STRING)"     WITH ", 10L);
  732.     Tree_WI(Formals->U_1.V_86.Formal.Name);
  733.     IO_WriteS(Tree_f, (STRING)"^.", 2L);
  734.     Tree_WI(t->U_1.V_45.OnePattern.Pattern->U_1.V_50.Decompose.Object->U_1.V_5.Class.Name);
  735.     IO_WriteS(Tree_f, (STRING)" DO", 3L);
  736.     IO_WriteNl(Tree_f);
  737.     break;
  738.   case Tree_VarDef:;
  739.   case Tree_NilTest:;
  740.   case Tree_Value:;
  741.   case Tree_DontCare1:;
  742.     break;
  743.   default :
  744.     return;
  745.     break;
  746.   }
  747.   Tg2(t->U_1.V_45.OnePattern.Next, Formals->U_1.V_86.Formal.Next);
  748. }
  749.  
  750. static void yyAbort
  751. # ifdef __STDC__
  752. (CHAR yyFunction[], LONGCARD O_1)
  753. # else
  754. (yyFunction, O_1)
  755. CHAR yyFunction[];
  756. LONGCARD O_1;
  757. # endif
  758. {
  759.   OPEN_ARRAY_LOCALS
  760.  
  761.   ALLOC_OPEN_ARRAYS(O_1 * sizeof(CHAR), 1)
  762.   COPY_OPEN_ARRAY(yyFunction, O_1, CHAR)
  763.   IO_WriteS((System_tFile)IO_StdError, (STRING)"Error: module Mod, routine ", 27L);
  764.   IO_WriteS((System_tFile)IO_StdError, yyFunction, O_1);
  765.   IO_WriteS((System_tFile)IO_StdError, (STRING)" failed", 7L);
  766.   IO_WriteNl((System_tFile)IO_StdError);
  767.   (*Mod_Exit)();
  768.   FREE_OPEN_ARRAYS
  769. }
  770.  
  771. static BOOLEAN yyIsEqual
  772. # ifdef __STDC__
  773. (BYTE yya[], LONGCARD O_3, BYTE yyb[], LONGCARD O_2)
  774. # else
  775. (yya, O_3, yyb, O_2)
  776. BYTE yya[];
  777. LONGCARD O_3;
  778. BYTE yyb[];
  779. LONGCARD O_2;
  780. # endif
  781. {
  782.   INTEGER yyi;
  783.   OPEN_ARRAY_LOCALS
  784.  
  785.   ALLOC_OPEN_ARRAYS(O_2 * sizeof(WORD) + O_3 * sizeof(WORD), 2)
  786.   COPY_OPEN_ARRAY(yyb, O_2, WORD)
  787.   COPY_OPEN_ARRAY(yya, O_3, WORD)
  788.   {
  789.     LONGINT B_1 = 0, B_2 = (INTEGER)(O_3 - 1);
  790.  
  791.     if (B_1 <= B_2)
  792.       for (yyi = B_1;; yyi += 1) {
  793.         if (yya[yyi] != yyb[yyi]) {
  794.           FREE_OPEN_ARRAYS
  795.           return FALSE;
  796.         }
  797.         if (yyi >= B_2) break;
  798.       }
  799.   }
  800.   FREE_OPEN_ARRAYS
  801.   return TRUE;
  802. }
  803.  
  804. void Mod_MacroMod
  805. # ifdef __STDC__
  806. (Tree_tTree t)
  807. # else
  808. (t)
  809. Tree_tTree t;
  810. # endif
  811. {
  812.   struct S_3 yyTempo;
  813.  
  814.   if (t == Tree_NoTree) {
  815.     return;
  816.   }
  817.   if (t->U_1.V_1.Kind == Tree_Spec) {
  818.     {
  819.       register Tree_ySpec *W_18 = &t->U_1.V_26.Spec;
  820.  
  821.       Mod_MacroMod(W_18->TreeNames);
  822.       return;
  823.     }
  824.   }
  825.   if (t->U_1.V_1.Kind == Tree_TreeName) {
  826.     {
  827.       register Tree_yTreeName *W_19 = &t->U_1.V_29.TreeName;
  828.  
  829.       IO_WriteS(Tree_f, (STRING)"# define begint", 15L);
  830.       Tree_WI(W_19->Name);
  831.       IO_WriteS(Tree_f, (STRING)"(a)    a := NIL;", 13L);
  832.       IO_WriteNl(Tree_f);
  833.       IO_WriteS(Tree_f, (STRING)"# define equalt", 15L);
  834.       Tree_WI(W_19->Name);
  835.       IO_WriteS(Tree_f, (STRING)"(a, b)    ", 7L);
  836.       Tree_WI(W_19->Name);
  837.       IO_WriteS(Tree_f, (STRING)".IsEqual", 8L);
  838.       Tree_WI(W_19->Name);
  839.       IO_WriteS(Tree_f, (STRING)" (a, b)", 7L);
  840.       IO_WriteNl(Tree_f);
  841.       Mod_MacroMod(W_19->Next);
  842.       return;
  843.     }
  844.   }
  845. }
  846.  
  847. void Mod_DefMod
  848. # ifdef __STDC__
  849. (Tree_tTree t)
  850. # else
  851. (t)
  852. Tree_tTree t;
  853. # endif
  854. {
  855.   struct S_4 yyTempo;
  856.  
  857.   if (t == Tree_NoTree) {
  858.     return;
  859.   }
  860.   if (t->U_1.V_1.Kind == Tree_Spec) {
  861.     {
  862.       register Tree_ySpec *W_20 = &t->U_1.V_26.Spec;
  863.  
  864.       IO_WriteS(Tree_f, (STRING)"DEFINITION MODULE ", 18L);
  865.       Tree_WI(W_20->TrafoName);
  866.       IO_WriteS(Tree_f, (STRING)";", 1L);
  867.       IO_WriteNl(Tree_f);
  868.       IO_WriteNl(Tree_f);
  869.       IO_WriteS(Tree_f, (STRING)"IMPORT SYSTEM, IO", 17L);
  870.       Mod_DefMod(W_20->TreeNames);
  871.       IO_WriteS(Tree_f, (STRING)";", 1L);
  872.       IO_WriteNl(Tree_f);
  873.       WriteLine(W_20->Codes->U_1.V_12.Codes.ImportLine);
  874.       Texts_WriteText(Tree_f, W_20->Codes->U_1.V_12.Codes.Import);
  875.       WriteLine(W_20->Codes->U_1.V_12.Codes.ExportLine);
  876.       Texts_WriteText(Tree_f, W_20->Codes->U_1.V_12.Codes.Export);
  877.       IO_WriteNl(Tree_f);
  878.       IO_WriteS(Tree_f, (STRING)"VAR yyf    : IO.tFile;", 19L);
  879.       IO_WriteNl(Tree_f);
  880.       IO_WriteS(Tree_f, (STRING)"VAR Exit    : PROC;", 16L);
  881.       IO_WriteNl(Tree_f);
  882.       IO_WriteNl(Tree_f);
  883.       Mod_DefMod(W_20->Public);
  884.       IO_WriteNl(Tree_f);
  885.       IO_WriteS(Tree_f, (STRING)"PROCEDURE Begin", 15L);
  886.       Tree_WI(W_20->TrafoName);
  887.       IO_WriteS(Tree_f, (STRING)";", 1L);
  888.       IO_WriteNl(Tree_f);
  889.       IO_WriteS(Tree_f, (STRING)"PROCEDURE Close", 15L);
  890.       Tree_WI(W_20->TrafoName);
  891.       IO_WriteS(Tree_f, (STRING)";", 1L);
  892.       IO_WriteNl(Tree_f);
  893.       IO_WriteNl(Tree_f);
  894.       IO_WriteS(Tree_f, (STRING)"END ", 4L);
  895.       Tree_WI(W_20->TrafoName);
  896.       IO_WriteS(Tree_f, (STRING)".", 1L);
  897.       IO_WriteNl(Tree_f);
  898.       return;
  899.     }
  900.   }
  901.   if (t->U_1.V_1.Kind == Tree_TreeName) {
  902.     {
  903.       register Tree_yTreeName *W_21 = &t->U_1.V_29.TreeName;
  904.  
  905.       IO_WriteS(Tree_f, (STRING)", ", 2L);
  906.       Tree_WI(W_21->Name);
  907.       Mod_DefMod(W_21->Next);
  908.       return;
  909.     }
  910.   }
  911.   if (t->U_1.V_1.Kind == Tree_Name) {
  912.     {
  913.       register Tree_yName *W_22 = &t->U_1.V_25.Name;
  914.  
  915.       if (W_22->Object != Tree_NoTree) {
  916.         ListCount = 0;
  917.         IO_WriteS(Tree_f, (STRING)"PROCEDURE ", 10L);
  918.         Tree_WI(W_22->Name);
  919.         IO_WriteS(Tree_f, (STRING)" (", 2L);
  920.         Mod_DefMod(W_22->Object->U_1.V_32.Routine.InForm);
  921.         Mod_DefMod(W_22->Object->U_1.V_32.Routine.OutForm);
  922.         IO_WriteS(Tree_f, (STRING)")", 1L);
  923.         if (W_22->Object->U_1.V_1.Kind == Tree_Predicate) {
  924.           IO_WriteS(Tree_f, (STRING)": BOOLEAN", 9L);
  925.         } else if (W_22->Object->U_1.V_1.Kind == Tree_Function) {
  926.           IO_WriteS(Tree_f, (STRING)": ", 2L);
  927.           Mod_DefMod(W_22->Object->U_1.V_34.Function.ReturnForm->U_1.V_86.Formal.TypeDesc);
  928.         }
  929.         IO_WriteS(Tree_f, (STRING)";", 1L);
  930.         IO_WriteNl(Tree_f);
  931.       }
  932.       Mod_DefMod(W_22->Next);
  933.       return;
  934.     }
  935.   }
  936.   if (t->U_1.V_1.Kind == Tree_Formal) {
  937.     {
  938.       register Tree_yFormal *W_23 = &t->U_1.V_86.Formal;
  939.  
  940.       if (ListCount > 0) {
  941.         IO_WriteS(Tree_f, (STRING)"; ", 2L);
  942.       }
  943.       if (W_23->Path->U_1.V_92.Var.IsOutput) {
  944.         IO_WriteS(Tree_f, (STRING)"VAR ", 4L);
  945.       }
  946.       Tree_WI(W_23->Name);
  947.       IO_WriteS(Tree_f, (STRING)": ", 2L);
  948.       Mod_DefMod(W_23->TypeDesc);
  949.       INC(ListCount);
  950.       Mod_DefMod(W_23->Next);
  951.       return;
  952.     }
  953.   }
  954.   if (t->U_1.V_1.Kind == Tree_NodeTypes) {
  955.     {
  956.       register Tree_yNodeTypes *W_24 = &t->U_1.V_89.NodeTypes;
  957.  
  958.       Tree_WI(W_24->TreeName->U_1.V_29.TreeName.Name);
  959.       IO_WriteS(Tree_f, (STRING)".t", 2L);
  960.       Tree_WI(W_24->TreeName->U_1.V_29.TreeName.Name);
  961.       return;
  962.     }
  963.   }
  964.   if (t->U_1.V_1.Kind == Tree_UserType) {
  965.     {
  966.       register Tree_yUserType *W_25 = &t->U_1.V_90.UserType;
  967.  
  968.       Tree_WI(W_25->Type);
  969.       return;
  970.     }
  971.   }
  972. }
  973.  
  974. void Mod_ImplMod
  975. # ifdef __STDC__
  976. (Tree_tTree t)
  977. # else
  978. (t)
  979. Tree_tTree t;
  980. # endif
  981. {
  982.   struct S_5 yyTempo;
  983.  
  984.   if (t == Tree_NoTree) {
  985.     return;
  986.   }
  987.   switch (t->U_1.V_1.Kind) {
  988.   case Tree_Spec:;
  989.     {
  990.       register Tree_ySpec *W_26 = &t->U_1.V_26.Spec;
  991.  
  992.       IO_WriteS(Tree_f, (STRING)"IMPLEMENTATION MODULE ", 22L);
  993.       Tree_WI(W_26->TrafoName);
  994.       IO_WriteS(Tree_f, (STRING)";", 1L);
  995.       IO_WriteNl(Tree_f);
  996.       if (!Sets_IsElement(ORD('m'), &Tree_Options)) {
  997.         IO_WriteS(Tree_f, (STRING)"# define yyInline", 17L);
  998.         IO_WriteNl(Tree_f);
  999.       }
  1000.       IO_WriteS(Tree_f, (STRING)"# ifdef yyInline", 16L);
  1001.       IO_WriteNl(Tree_f);
  1002.       IO_WriteS(Tree_f, (STRING)"# define yyALLOC(tree, make, ptr, kind) \\", 41L);
  1003.       IO_WriteNl(Tree_f);
  1004.       IO_WriteS(Tree_f, (STRING)"  ptr := tree.yyPoolFreePtr; \\", 30L);
  1005.       IO_WriteNl(Tree_f);
  1006.       IO_WriteS(Tree_f, (STRING)"  IF SYSTEM.ADDRESS (ptr) >= tree.yyPoolMaxPtr THEN ptr := tree.yyAlloc (); END; \\", 82L);
  1007.       IO_WriteNl(Tree_f);
  1008.       IO_WriteS(Tree_f, (STRING)"  INC (tree.yyPoolFreePtr, tree.yyNodeSize [tree.kind]); \\", 58L);
  1009.       IO_WriteNl(Tree_f);
  1010.       IO_WriteS(Tree_f, (STRING)"  ptr^.yyHead.yyMark := 0; \\", 28L);
  1011.       IO_WriteNl(Tree_f);
  1012.       IO_WriteS(Tree_f, (STRING)"  ptr^.Kind := tree.kind;", 25L);
  1013.       IO_WriteNl(Tree_f);
  1014.       IO_WriteS(Tree_f, (STRING)"# else", 6L);
  1015.       IO_WriteNl(Tree_f);
  1016.       IO_WriteS(Tree_f, (STRING)"# define yyALLOC(tree, make, ptr, kind) ptr := tree.make (tree.kind);", 69L);
  1017.       IO_WriteNl(Tree_f);
  1018.       IO_WriteS(Tree_f, (STRING)"# endif", 7L);
  1019.       IO_WriteNl(Tree_f);
  1020.       IO_WriteNl(Tree_f);
  1021.       IO_WriteS(Tree_f, (STRING)"# define yyWrite(s) IO.WriteS (yyf, s)", 38L);
  1022.       IO_WriteNl(Tree_f);
  1023.       IO_WriteS(Tree_f, (STRING)"# define yyWriteNl IO.WriteNl (yyf)", 35L);
  1024.       IO_WriteNl(Tree_f);
  1025.       IO_WriteNl(Tree_f);
  1026.       IO_WriteS(Tree_f, (STRING)"IMPORT SYSTEM, System, IO", 25L);
  1027.       Mod_DefMod(W_26->TreeNames);
  1028.       IO_WriteS(Tree_f, (STRING)";", 1L);
  1029.       IO_WriteNl(Tree_f);
  1030.       WriteLine(W_26->Codes->U_1.V_12.Codes.GlobalLine);
  1031.       Texts_WriteText(Tree_f, W_26->Codes->U_1.V_12.Codes.Global);
  1032.       IO_WriteS(Tree_f, (STRING)"# include \"yy", 13L);
  1033.       Tree_WI(W_26->TrafoName);
  1034.       IO_WriteS(Tree_f, (STRING)".w\"", 3L);
  1035.       IO_WriteNl(Tree_f);
  1036.       IO_WriteNl(Tree_f);
  1037.       IO_WriteS(Tree_f, (STRING)"PROCEDURE yyAbort (yyFunction: ARRAY OF CHAR);", 46L);
  1038.       IO_WriteNl(Tree_f);
  1039.       IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  1040.       IO_WriteNl(Tree_f);
  1041.       IO_WriteS(Tree_f, (STRING)"  IO.WriteS (IO.StdError, 'Error: module ", 41L);
  1042.       Tree_WI(W_26->TrafoName);
  1043.       IO_WriteS(Tree_f, (STRING)", routine ');", 13L);
  1044.       IO_WriteNl(Tree_f);
  1045.       IO_WriteS(Tree_f, (STRING)"  IO.WriteS (IO.StdError, yyFunction);", 38L);
  1046.       IO_WriteNl(Tree_f);
  1047.       IO_WriteS(Tree_f, (STRING)"  IO.WriteS (IO.StdError, ' failed');", 37L);
  1048.       IO_WriteNl(Tree_f);
  1049.       IO_WriteS(Tree_f, (STRING)"  IO.WriteNl (IO.StdError);", 27L);
  1050.       IO_WriteNl(Tree_f);
  1051.       IO_WriteS(Tree_f, (STRING)"  Exit;", 7L);
  1052.       IO_WriteNl(Tree_f);
  1053.       IO_WriteS(Tree_f, (STRING)" END yyAbort;", 13L);
  1054.       IO_WriteNl(Tree_f);
  1055.       IO_WriteNl(Tree_f);
  1056.       IO_WriteS(Tree_f, (STRING)"PROCEDURE yyIsEqual (yya, yyb: ARRAY OF SYSTEM.BYTE): BOOLEAN;", 62L);
  1057.       IO_WriteNl(Tree_f);
  1058.       IO_WriteS(Tree_f, (STRING)" VAR yyi    : INTEGER;", 19L);
  1059.       IO_WriteNl(Tree_f);
  1060.       IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  1061.       IO_WriteNl(Tree_f);
  1062.       IO_WriteS(Tree_f, (STRING)"  FOR yyi := 0 TO INTEGER (HIGH (yya)) DO", 41L);
  1063.       IO_WriteNl(Tree_f);
  1064.       IO_WriteS(Tree_f, (STRING)"   IF yya [yyi] # yyb [yyi] THEN RETURN FALSE; END;", 51L);
  1065.       IO_WriteNl(Tree_f);
  1066.       IO_WriteS(Tree_f, (STRING)"  END;", 6L);
  1067.       IO_WriteNl(Tree_f);
  1068.       IO_WriteS(Tree_f, (STRING)"  RETURN TRUE;", 14L);
  1069.       IO_WriteNl(Tree_f);
  1070.       IO_WriteS(Tree_f, (STRING)" END yyIsEqual;", 15L);
  1071.       IO_WriteNl(Tree_f);
  1072.       IO_WriteNl(Tree_f);
  1073.       Mod_ImplMod(W_26->Routines);
  1074.       IO_WriteS(Tree_f, (STRING)"PROCEDURE Begin", 15L);
  1075.       Tree_WI(W_26->TrafoName);
  1076.       IO_WriteS(Tree_f, (STRING)";", 1L);
  1077.       IO_WriteNl(Tree_f);
  1078.       IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  1079.       IO_WriteNl(Tree_f);
  1080.       WriteLine(W_26->Codes->U_1.V_12.Codes.BeginLine);
  1081.       Texts_WriteText(Tree_f, W_26->Codes->U_1.V_12.Codes.Begin);
  1082.       IO_WriteS(Tree_f, (STRING)" END Begin", 10L);
  1083.       Tree_WI(W_26->TrafoName);
  1084.       IO_WriteS(Tree_f, (STRING)";", 1L);
  1085.       IO_WriteNl(Tree_f);
  1086.       IO_WriteNl(Tree_f);
  1087.       IO_WriteS(Tree_f, (STRING)"PROCEDURE Close", 15L);
  1088.       Tree_WI(W_26->TrafoName);
  1089.       IO_WriteS(Tree_f, (STRING)";", 1L);
  1090.       IO_WriteNl(Tree_f);
  1091.       IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  1092.       IO_WriteNl(Tree_f);
  1093.       WriteLine(W_26->Codes->U_1.V_12.Codes.CloseLine);
  1094.       Texts_WriteText(Tree_f, W_26->Codes->U_1.V_12.Codes.Close);
  1095.       IO_WriteS(Tree_f, (STRING)" END Close", 10L);
  1096.       Tree_WI(W_26->TrafoName);
  1097.       IO_WriteS(Tree_f, (STRING)";", 1L);
  1098.       IO_WriteNl(Tree_f);
  1099.       IO_WriteNl(Tree_f);
  1100.       IO_WriteS(Tree_f, (STRING)"PROCEDURE yyExit;", 17L);
  1101.       IO_WriteNl(Tree_f);
  1102.       IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  1103.       IO_WriteNl(Tree_f);
  1104.       IO_WriteS(Tree_f, (STRING)"  IO.CloseIO; System.Exit (1);", 30L);
  1105.       IO_WriteNl(Tree_f);
  1106.       IO_WriteS(Tree_f, (STRING)" END yyExit;", 12L);
  1107.       IO_WriteNl(Tree_f);
  1108.       IO_WriteNl(Tree_f);
  1109.       IO_WriteS(Tree_f, (STRING)"BEGIN", 5L);
  1110.       IO_WriteNl(Tree_f);
  1111.       IO_WriteS(Tree_f, (STRING)" yyf    := IO.StdOutput;", 21L);
  1112.       IO_WriteNl(Tree_f);
  1113.       IO_WriteS(Tree_f, (STRING)" Exit    := yyExit;", 16L);
  1114.       IO_WriteNl(Tree_f);
  1115.       IO_WriteS(Tree_f, (STRING)" Begin", 6L);
  1116.       Tree_WI(W_26->TrafoName);
  1117.       IO_WriteS(Tree_f, (STRING)";", 1L);
  1118.       IO_WriteNl(Tree_f);
  1119.       IO_WriteS(Tree_f, (STRING)"END ", 4L);
  1120.       Tree_WI(W_26->TrafoName);
  1121.       IO_WriteS(Tree_f, (STRING)".", 1L);
  1122.       IO_WriteNl(Tree_f);
  1123.       return;
  1124.     }
  1125.     break;
  1126.   case Tree_Procedure:;
  1127.     {
  1128.       register Tree_yProcedure *W_27 = &t->U_1.V_33.Procedure;
  1129.  
  1130.       ListCount = 0;
  1131.       IO_WriteS(Tree_f, (STRING)"PROCEDURE ", 10L);
  1132.       Tree_WI(W_27->Name);
  1133.       IO_WriteS(Tree_f, (STRING)" (", 2L);
  1134.       Mod_DefMod(W_27->InForm);
  1135.       Mod_DefMod(W_27->OutForm);
  1136.       IO_WriteS(Tree_f, (STRING)");", 2L);
  1137.       IO_WriteNl(Tree_f);
  1138.       WriteLine(W_27->LocalLine);
  1139.       Texts_WriteText(Tree_f, W_27->Local);
  1140.       IO_WriteS(Tree_f, (STRING)" VAR yyTempo: RECORD CASE : INTEGER OF", 38L);
  1141.       IO_WriteNl(Tree_f);
  1142.       RoutineKind = kProcedure;
  1143.       InFormals = W_27->InForm;
  1144.       OutFormals = W_27->OutForm;
  1145.       Declare(W_27->Rules);
  1146.       IO_WriteS(Tree_f, (STRING)" END; END;", 10L);
  1147.       IO_WriteNl(Tree_f);
  1148.       IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  1149.       IO_WriteNl(Tree_f);
  1150.       if (Sets_IsElement(ORD('n'), &Tree_Options)) {
  1151.         Tg1(W_27->InForm);
  1152.       }
  1153.       if (Sets_IsElement(ORD('b'), &Tree_Options)) {
  1154.         Mod_ImplMod(W_27->Rules);
  1155.         if (Sets_IsElement(ORD('f'), &Tree_Options)) {
  1156.           IO_WriteS(Tree_f, (STRING)"  yyAbort ('", 12L);
  1157.           Tree_WI(W_27->Name);
  1158.           IO_WriteS(Tree_f, (STRING)"');", 3L);
  1159.           IO_WriteNl(Tree_f);
  1160.         }
  1161.       } else {
  1162.         TemposDone = FALSE;
  1163.         CommonTestElim(W_27->Decisions);
  1164.         if (Sets_IsElement(ORD('f'), &Tree_Options) && !Optimize_NeedsNoFinale(W_27->Decisions)) {
  1165.           IO_WriteS(Tree_f, (STRING)"  yyAbort ('", 12L);
  1166.           Tree_WI(W_27->Name);
  1167.           IO_WriteS(Tree_f, (STRING)"');", 3L);
  1168.           IO_WriteNl(Tree_f);
  1169.         }
  1170.       }
  1171.       IO_WriteS(Tree_f, (STRING)" END ", 5L);
  1172.       Tree_WI(W_27->Name);
  1173.       IO_WriteS(Tree_f, (STRING)";", 1L);
  1174.       IO_WriteNl(Tree_f);
  1175.       IO_WriteNl(Tree_f);
  1176.       Mod_ImplMod(W_27->Next);
  1177.       return;
  1178.     }
  1179.     break;
  1180.   case Tree_Function:;
  1181.     {
  1182.       register Tree_yFunction *W_28 = &t->U_1.V_34.Function;
  1183.  
  1184.       ListCount = 0;
  1185.       IO_WriteS(Tree_f, (STRING)"PROCEDURE ", 10L);
  1186.       Tree_WI(W_28->Name);
  1187.       IO_WriteS(Tree_f, (STRING)" (", 2L);
  1188.       Mod_DefMod(W_28->InForm);
  1189.       Mod_DefMod(W_28->OutForm);
  1190.       IO_WriteS(Tree_f, (STRING)"): ", 3L);
  1191.       Mod_DefMod(W_28->ReturnForm->U_1.V_86.Formal.TypeDesc);
  1192.       IO_WriteS(Tree_f, (STRING)";", 1L);
  1193.       IO_WriteNl(Tree_f);
  1194.       WriteLine(W_28->LocalLine);
  1195.       Texts_WriteText(Tree_f, W_28->Local);
  1196.       IO_WriteS(Tree_f, (STRING)" VAR yyTempo: RECORD CASE : INTEGER OF", 38L);
  1197.       IO_WriteNl(Tree_f);
  1198.       RoutineKind = kFunction;
  1199.       InFormals = W_28->InForm;
  1200.       OutFormals = W_28->OutForm;
  1201.       ReturnFormals = W_28->ReturnForm;
  1202.       Declare(W_28->Rules);
  1203.       IO_WriteS(Tree_f, (STRING)" END; END;", 10L);
  1204.       IO_WriteNl(Tree_f);
  1205.       IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  1206.       IO_WriteNl(Tree_f);
  1207.       if (Sets_IsElement(ORD('b'), &Tree_Options)) {
  1208.         Mod_ImplMod(W_28->Rules);
  1209.         IO_WriteS(Tree_f, (STRING)"  yyAbort ('", 12L);
  1210.         Tree_WI(W_28->Name);
  1211.         IO_WriteS(Tree_f, (STRING)"');", 3L);
  1212.         IO_WriteNl(Tree_f);
  1213.       } else {
  1214.         TemposDone = FALSE;
  1215.         CommonTestElim(W_28->Decisions);
  1216.         if (!Optimize_NeedsNoFinale(W_28->Decisions)) {
  1217.           IO_WriteS(Tree_f, (STRING)"  yyAbort ('", 12L);
  1218.           Tree_WI(W_28->Name);
  1219.           IO_WriteS(Tree_f, (STRING)"');", 3L);
  1220.           IO_WriteNl(Tree_f);
  1221.         }
  1222.       }
  1223.       IO_WriteS(Tree_f, (STRING)" END ", 5L);
  1224.       Tree_WI(W_28->Name);
  1225.       IO_WriteS(Tree_f, (STRING)";", 1L);
  1226.       IO_WriteNl(Tree_f);
  1227.       IO_WriteNl(Tree_f);
  1228.       Mod_ImplMod(W_28->Next);
  1229.       return;
  1230.     }
  1231.     break;
  1232.   case Tree_Predicate:;
  1233.     {
  1234.       register Tree_yPredicate *W_29 = &t->U_1.V_35.Predicate;
  1235.  
  1236.       ListCount = 0;
  1237.       IO_WriteS(Tree_f, (STRING)"PROCEDURE ", 10L);
  1238.       Tree_WI(W_29->Name);
  1239.       IO_WriteS(Tree_f, (STRING)" (", 2L);
  1240.       Mod_DefMod(W_29->InForm);
  1241.       Mod_DefMod(W_29->OutForm);
  1242.       IO_WriteS(Tree_f, (STRING)"): BOOLEAN;", 11L);
  1243.       IO_WriteNl(Tree_f);
  1244.       WriteLine(W_29->LocalLine);
  1245.       Texts_WriteText(Tree_f, W_29->Local);
  1246.       IO_WriteS(Tree_f, (STRING)" VAR yyTempo: RECORD CASE : INTEGER OF", 38L);
  1247.       IO_WriteNl(Tree_f);
  1248.       RoutineKind = kPredicate;
  1249.       InFormals = W_29->InForm;
  1250.       OutFormals = W_29->OutForm;
  1251.       Declare(W_29->Rules);
  1252.       IO_WriteS(Tree_f, (STRING)" END; END;", 10L);
  1253.       IO_WriteNl(Tree_f);
  1254.       IO_WriteS(Tree_f, (STRING)" BEGIN", 6L);
  1255.       IO_WriteNl(Tree_f);
  1256.       if (Sets_IsElement(ORD('n'), &Tree_Options)) {
  1257.         Tg1(W_29->InForm);
  1258.       }
  1259.       if (Sets_IsElement(ORD('b'), &Tree_Options)) {
  1260.         Mod_ImplMod(W_29->Rules);
  1261.         IO_WriteS(Tree_f, (STRING)"  RETURN FALSE;", 15L);
  1262.         IO_WriteNl(Tree_f);
  1263.       } else {
  1264.         TemposDone = FALSE;
  1265.         CommonTestElim(W_29->Decisions);
  1266.         if (!Optimize_NeedsNoFinale(W_29->Decisions)) {
  1267.           IO_WriteS(Tree_f, (STRING)"  RETURN FALSE;", 15L);
  1268.           IO_WriteNl(Tree_f);
  1269.         }
  1270.       }
  1271.       IO_WriteS(Tree_f, (STRING)" END ", 5L);
  1272.       Tree_WI(W_29->Name);
  1273.       IO_WriteS(Tree_f, (STRING)";", 1L);
  1274.       IO_WriteNl(Tree_f);
  1275.       IO_WriteNl(Tree_f);
  1276.       Mod_ImplMod(W_29->Next);
  1277.       return;
  1278.     }
  1279.     break;
  1280.   case Tree_Rule:;
  1281.     {
  1282.       register Tree_yRule *W_30 = &t->U_1.V_42.Rule;
  1283.  
  1284.       WriteLine(W_30->Line);
  1285.       if (W_30->HasTempos) {
  1286.         IO_WriteS(Tree_f, (STRING)"    WITH yyTempo.yyR", 20L);
  1287.         Tree_WN((LONGINT)W_30->Index);
  1288.         IO_WriteS(Tree_f, (STRING)" DO", 3L);
  1289.       }
  1290.       IO_WriteS(Tree_f, (STRING)"   LOOP", 7L);
  1291.       IO_WriteNl(Tree_f);
  1292.       Decls = W_30->VarDecls;
  1293.       Match(W_30->Patterns, InFormals);
  1294.       if (Sets_IsElement(ORD('w'), &Tree_Options) && W_30->Statements->U_1.V_1.Kind != Tree_NoStatement) {
  1295.         Tg2(W_30->Patterns, InFormals);
  1296.       }
  1297.       Mod_ImplMod(W_30->Statements);
  1298.       if (!W_30->HasRejectOrFail) {
  1299.         AssignFormals(W_30->Exprs, OutFormals);
  1300.         MatchExprs(W_30->Exprs);
  1301.         switch (RoutineKind) {
  1302.         case kProcedure:;
  1303.           IO_WriteS(Tree_f, (STRING)"      RETURN;", 13L);
  1304.           IO_WriteNl(Tree_f);
  1305.           break;
  1306.         case kFunction:;
  1307.           AssignTempo(W_30->Expr);
  1308.           if (W_30->HasPatterns && W_30->Expr->U_1.V_1.Kind != Tree_Compose && t->U_1.V_1.Kind != Tree_DontCare1) {
  1309.             IO_WriteS(Tree_f, (STRING)"      ", 6L);
  1310.             Tree_WI(W_30->Tempo);
  1311.             IO_WriteS(Tree_f, (STRING)" := ", 4L);
  1312.             Expression(W_30->Expr);
  1313.             IO_WriteS(Tree_f, (STRING)";", 1L);
  1314.             IO_WriteNl(Tree_f);
  1315.             MatchExpr(W_30->Expr);
  1316.             IO_WriteS(Tree_f, (STRING)"      RETURN ", 13L);
  1317.             Tree_WI(W_30->Tempo);
  1318.             IO_WriteS(Tree_f, (STRING)";", 1L);
  1319.             IO_WriteNl(Tree_f);
  1320.           } else {
  1321.             MatchExpr(W_30->Expr);
  1322.             IO_WriteS(Tree_f, (STRING)"      RETURN ", 13L);
  1323.             Expression(W_30->Expr);
  1324.             IO_WriteS(Tree_f, (STRING)";", 1L);
  1325.             IO_WriteNl(Tree_f);
  1326.           }
  1327.           break;
  1328.         case kPredicate:;
  1329.           IO_WriteS(Tree_f, (STRING)"      RETURN TRUE;", 18L);
  1330.           IO_WriteNl(Tree_f);
  1331.           break;
  1332.         }
  1333.       }
  1334.       if (Sets_IsElement(ORD('w'), &Tree_Options) && W_30->Statements->U_1.V_1.Kind != Tree_NoStatement) {
  1335.         Tg3(W_30->Patterns);
  1336.       }
  1337.       IO_WriteS(Tree_f, (STRING)"   END;", 7L);
  1338.       IO_WriteNl(Tree_f);
  1339.       if (W_30->HasTempos) {
  1340.         IO_WriteS(Tree_f, (STRING)"    END;", 8L);
  1341.         IO_WriteNl(Tree_f);
  1342.       }
  1343.       IO_WriteNl(Tree_f);
  1344.       Mod_ImplMod(W_30->Next);
  1345.       return;
  1346.     }
  1347.     break;
  1348.   case Tree_ProcCall:;
  1349.     {
  1350.       register Tree_yProcCall *W_31 = &t->U_1.V_76.ProcCall;
  1351.  
  1352.       WriteLine(W_31->Pos);
  1353.       AssignTempo(W_31->Call);
  1354.       IO_WriteS(Tree_f, (STRING)"      ", 6L);
  1355.       Expression(W_31->Call);
  1356.       IO_WriteS(Tree_f, (STRING)";", 1L);
  1357.       IO_WriteNl(Tree_f);
  1358.       MatchExpr(W_31->Call);
  1359.       Mod_ImplMod(W_31->Next);
  1360.       return;
  1361.     }
  1362.     break;
  1363.   case Tree_Condition:;
  1364.     {
  1365.       register Tree_yCondition *W_32 = &t->U_1.V_77.Condition;
  1366.  
  1367.       WriteLine(W_32->Pos);
  1368.       AssignTempo(W_32->Expr);
  1369.       IO_WriteS(Tree_f, (STRING)"      IF NOT (", 14L);
  1370.       Expression(W_32->Expr);
  1371.       IO_WriteS(Tree_f, (STRING)") THEN EXIT; END;", 17L);
  1372.       IO_WriteNl(Tree_f);
  1373.       MatchExpr(W_32->Expr);
  1374.       Mod_ImplMod(W_32->Next);
  1375.       return;
  1376.     }
  1377.     break;
  1378.   case Tree_Assignment:;
  1379.     {
  1380.       register Tree_yAssignment *W_33 = &t->U_1.V_78.Assignment;
  1381.  
  1382.       WriteLine(W_33->Pos);
  1383.       AssignTempo(W_33->Adr);
  1384.       AssignTempo(W_33->Expr);
  1385.       if (W_33->Object != Tree_NoTree) {
  1386.         IO_WriteS(Tree_f, (STRING)"      ", 6L);
  1387.         Mod_ImplMod(W_33->Object->U_1.V_86.Formal.Path);
  1388.       } else {
  1389.         IO_WriteS(Tree_f, (STRING)"      ", 6L);
  1390.         Expression(W_33->Adr);
  1391.       }
  1392.       IO_WriteS(Tree_f, (STRING)" := ", 4L);
  1393.       Expression(W_33->Expr);
  1394.       IO_WriteS(Tree_f, (STRING)";", 1L);
  1395.       IO_WriteNl(Tree_f);
  1396.       MatchExpr(W_33->Adr);
  1397.       MatchExpr(W_33->Expr);
  1398.       Mod_ImplMod(W_33->Next);
  1399.       return;
  1400.     }
  1401.     break;
  1402.   case Tree_Reject:;
  1403.     {
  1404.       register Tree_yReject *W_34 = &t->U_1.V_79.Reject;
  1405.  
  1406.       WriteLine(W_34->Pos);
  1407.       IO_WriteS(Tree_f, (STRING)"      EXIT;", 11L);
  1408.       IO_WriteNl(Tree_f);
  1409.       return;
  1410.     }
  1411.     break;
  1412.   case Tree_Fail:;
  1413.     {
  1414.       register Tree_yFail *W_35 = &t->U_1.V_80.Fail;
  1415.  
  1416.       WriteLine(W_35->Pos);
  1417.       IO_WriteS(Tree_f, (STRING)"      RETURN", 12L);
  1418.       if (RoutineKind == kPredicate) {
  1419.         IO_WriteS(Tree_f, (STRING)" FALSE", 6L);
  1420.       }
  1421.       IO_WriteS(Tree_f, (STRING)";", 1L);
  1422.       IO_WriteNl(Tree_f);
  1423.       return;
  1424.     }
  1425.     break;
  1426.   case Tree_TargetStmt:;
  1427.     {
  1428.       register Tree_yTargetStmt *W_36 = &t->U_1.V_81.TargetStmt;
  1429.  
  1430.       WriteLine(W_36->Pos);
  1431.       IO_WriteS(Tree_f, (STRING)"      ", 6L);
  1432.       Mod_ImplMod(W_36->Stmt);
  1433.       IO_WriteS(Tree_f, (STRING)";", 1L);
  1434.       IO_WriteNl(Tree_f);
  1435.       Mod_ImplMod(W_36->Next);
  1436.       return;
  1437.     }
  1438.     break;
  1439.   case Tree_Nl:;
  1440.     {
  1441.       register Tree_yNl *W_37 = &t->U_1.V_82.Nl;
  1442.  
  1443.       WriteLine(W_37->Pos);
  1444.       IO_WriteS(Tree_f, (STRING)"      yyWriteNl;", 16L);
  1445.       IO_WriteNl(Tree_f);
  1446.       Mod_ImplMod(W_37->Next);
  1447.       return;
  1448.     }
  1449.     break;
  1450.   case Tree_WriteStr:;
  1451.     {
  1452.       register Tree_yWriteStr *W_38 = &t->U_1.V_83.WriteStr;
  1453.  
  1454.       WriteLine(W_38->Pos);
  1455.       IO_WriteS(Tree_f, (STRING)"      yyWrite (", 15L);
  1456.       StringMem_WriteString(Tree_f, W_38->String);
  1457.       IO_WriteS(Tree_f, (STRING)");", 2L);
  1458.       IO_WriteNl(Tree_f);
  1459.       Mod_ImplMod(W_38->Next);
  1460.       return;
  1461.     }
  1462.     break;
  1463.   case Tree_Ident:;
  1464.     {
  1465.       register struct S_6 *W_39 = &yyTempo.U_1.V_1.yyR14;
  1466.  
  1467.       {
  1468.         register Tree_yIdent *W_40 = &t->U_1.V_16.Ident;
  1469.  
  1470.         W_39->Var = Semantics_IdentifyVar(Decls, W_40->Attribute);
  1471.         if (W_39->Var != Tree_NoTree) {
  1472.           Mod_ImplMod(W_39->Var->U_1.V_86.Formal.Path);
  1473.         } else {
  1474.           Tree_WI(W_40->Attribute);
  1475.         }
  1476.         Mod_ImplMod(W_40->Next);
  1477.         return;
  1478.       }
  1479.     }
  1480.     break;
  1481.   case Tree_Any:;
  1482.     {
  1483.       register Tree_yAny *W_41 = &t->U_1.V_18.Any;
  1484.  
  1485.       StringMem_WriteString(Tree_f, W_41->Code);
  1486.       Mod_ImplMod(W_41->Next);
  1487.       return;
  1488.     }
  1489.     break;
  1490.   case Tree_Anys:;
  1491.     {
  1492.       register Tree_yAnys *W_42 = &t->U_1.V_19.Anys;
  1493.  
  1494.       Mod_ImplMod(W_42->Layouts);
  1495.       Mod_ImplMod(W_42->Next);
  1496.       return;
  1497.     }
  1498.     break;
  1499.   case Tree_LayoutAny:;
  1500.     {
  1501.       register Tree_yLayoutAny *W_43 = &t->U_1.V_22.LayoutAny;
  1502.  
  1503.       StringMem_WriteString(Tree_f, W_43->Code);
  1504.       Mod_ImplMod(W_43->Next);
  1505.       return;
  1506.     }
  1507.     break;
  1508.   case Tree_Designator:;
  1509.     {
  1510.       register Tree_yDesignator *W_44 = &t->U_1.V_15.Designator;
  1511.  
  1512.       Mod_ImplMod(W_44->Object->U_1.V_86.Formal.Path);
  1513.       IO_WriteS(Tree_f, (STRING)"^.", 2L);
  1514.       Tree_WI(W_44->Type);
  1515.       IO_WriteS(Tree_f, (STRING)".", 1L);
  1516.       Tree_WI(W_44->Attribute);
  1517.       Mod_ImplMod(W_44->Next);
  1518.       return;
  1519.     }
  1520.     break;
  1521.   case Tree_Field:;
  1522.     {
  1523.       register Tree_yField *W_45 = &t->U_1.V_94.Field;
  1524.  
  1525.       Mod_ImplMod(W_45->Next);
  1526.       IO_WriteS(Tree_f, (STRING)".", 1L);
  1527.       Tree_WI(W_45->Name);
  1528.       return;
  1529.     }
  1530.     break;
  1531.   case Tree_ConsType:;
  1532.     {
  1533.       register Tree_yConsType *W_46 = &t->U_1.V_93.ConsType;
  1534.  
  1535.       Mod_ImplMod(W_46->Next);
  1536.       IO_WriteS(Tree_f, (STRING)"^.", 2L);
  1537.       Tree_WI(W_46->Name);
  1538.       return;
  1539.     }
  1540.     break;
  1541.   case Tree_Var:;
  1542.     {
  1543.       register Tree_yVar *W_47 = &t->U_1.V_92.Var;
  1544.  
  1545.       Tree_WI(W_47->Name);
  1546.       return;
  1547.     }
  1548.     break;
  1549.   case Tree_NodeTypes:;
  1550.     {
  1551.       register Tree_yNodeTypes *W_48 = &t->U_1.V_89.NodeTypes;
  1552.  
  1553.       IO_WriteS(Tree_f, (STRING)"t", 1L);
  1554.       Tree_WI(W_48->TreeName->U_1.V_29.TreeName.Name);
  1555.       return;
  1556.     }
  1557.     break;
  1558.   case Tree_UserType:;
  1559.     {
  1560.       register Tree_yUserType *W_49 = &t->U_1.V_90.UserType;
  1561.  
  1562.       Tree_WI(W_49->Type);
  1563.       return;
  1564.     }
  1565.     break;
  1566.   default :
  1567.     break;
  1568.   }
  1569. }
  1570.  
  1571. static void Declare
  1572. # ifdef __STDC__
  1573. (Tree_tTree t)
  1574. # else
  1575. (t)
  1576. Tree_tTree t;
  1577. # endif
  1578. {
  1579.   struct S_7 yyTempo;
  1580.  
  1581.   if (t == Tree_NoTree) {
  1582.     return;
  1583.   }
  1584.   switch (t->U_1.V_1.Kind) {
  1585.   case Tree_Formal:;
  1586.     {
  1587.       register Tree_yFormal *W_50 = &t->U_1.V_86.Formal;
  1588.  
  1589.       IO_WriteS(Tree_f, (STRING)"  ", 2L);
  1590.       Tree_WI(W_50->Name);
  1591.       IO_WriteS(Tree_f, (STRING)": ", 2L);
  1592.       Mod_DefMod(W_50->TypeDesc);
  1593.       IO_WriteS(Tree_f, (STRING)";", 1L);
  1594.       IO_WriteNl(Tree_f);
  1595.       Declare(W_50->Next);
  1596.       return;
  1597.     }
  1598.     break;
  1599.   case Tree_Param:;
  1600.     {
  1601.       register struct S_8 *W_51 = &yyTempo.U_1.V_1.yyR2;
  1602.  
  1603.       {
  1604.         register Tree_yParam *W_52 = &t->U_1.V_38.Param;
  1605.  
  1606.         W_51->Var = Semantics_IdentifyVar(Decls, W_52->Name);
  1607.         IO_WriteS(Tree_f, (STRING)"  ", 2L);
  1608.         Tree_WI(W_52->Name);
  1609.         IO_WriteS(Tree_f, (STRING)": ", 2L);
  1610.         Mod_DefMod(W_51->Var->U_1.V_86.Formal.TypeDesc);
  1611.         IO_WriteS(Tree_f, (STRING)";", 1L);
  1612.         IO_WriteNl(Tree_f);
  1613.         Declare(W_52->Next);
  1614.         return;
  1615.       }
  1616.     }
  1617.     break;
  1618.   case Tree_Rule:;
  1619.     {
  1620.       register Tree_yRule *W_53 = &t->U_1.V_42.Rule;
  1621.  
  1622.       if (W_53->HasTempos) {
  1623.         IO_WriteS(Tree_f, (STRING)" | ", 3L);
  1624.         Tree_WN((LONGINT)W_53->Index);
  1625.         IO_WriteS(Tree_f, (STRING)": yyR", 5L);
  1626.         Tree_WN((LONGINT)W_53->Index);
  1627.         IO_WriteS(Tree_f, (STRING)": RECORD", 8L);
  1628.         IO_WriteNl(Tree_f);
  1629.         Decls = W_53->VarDecls;
  1630.         Declare(W_53->Patterns);
  1631.         Declare(W_53->Exprs);
  1632.         if (RoutineKind == kFunction) {
  1633.           Declare(W_53->Expr);
  1634.           if (W_53->HasPatterns && W_53->Expr->U_1.V_1.Kind != Tree_Compose && t->U_1.V_1.Kind != Tree_DontCare1) {
  1635.             IO_WriteS(Tree_f, (STRING)"  ", 2L);
  1636.             Tree_WI(W_53->Tempo);
  1637.             IO_WriteS(Tree_f, (STRING)": ", 2L);
  1638.             Mod_DefMod(ReturnFormals->U_1.V_86.Formal.TypeDesc);
  1639.             IO_WriteS(Tree_f, (STRING)";", 1L);
  1640.             IO_WriteNl(Tree_f);
  1641.           }
  1642.         }
  1643.         Declare(W_53->Statements);
  1644.         IO_WriteS(Tree_f, (STRING)"  END;", 6L);
  1645.         IO_WriteNl(Tree_f);
  1646.       }
  1647.       Declare(W_53->Next);
  1648.       return;
  1649.     }
  1650.     break;
  1651.   case Tree_ProcCall:;
  1652.     {
  1653.       register Tree_yProcCall *W_54 = &t->U_1.V_76.ProcCall;
  1654.  
  1655.       Declare(W_54->Call);
  1656.       Declare(W_54->Next);
  1657.       return;
  1658.     }
  1659.     break;
  1660.   case Tree_Condition:;
  1661.     {
  1662.       register Tree_yCondition *W_55 = &t->U_1.V_77.Condition;
  1663.  
  1664.       Declare(W_55->Expr);
  1665.       Declare(W_55->Next);
  1666.       return;
  1667.     }
  1668.     break;
  1669.   case Tree_Assignment:;
  1670.     {
  1671.       register Tree_yAssignment *W_56 = &t->U_1.V_78.Assignment;
  1672.  
  1673.       Declare(W_56->Adr);
  1674.       Declare(W_56->Expr);
  1675.       Declare(W_56->Next);
  1676.       return;
  1677.     }
  1678.     break;
  1679.   case Tree_TargetStmt:;
  1680.     {
  1681.       register Tree_yTargetStmt *W_57 = &t->U_1.V_81.TargetStmt;
  1682.  
  1683.       Declare(W_57->Parameters);
  1684.       Declare(W_57->Next);
  1685.       return;
  1686.     }
  1687.     break;
  1688.   case Tree_Statement:;
  1689.   case Tree_Reject:;
  1690.   case Tree_Fail:;
  1691.   case Tree_Nl:;
  1692.   case Tree_WriteStr:;
  1693.     {
  1694.       register Tree_yStatement *W_58 = &t->U_1.V_75.Statement;
  1695.  
  1696.       Declare(W_58->Next);
  1697.       return;
  1698.     }
  1699.     break;
  1700.   case Tree_OnePattern:;
  1701.     {
  1702.       register Tree_yOnePattern *W_59 = &t->U_1.V_45.OnePattern;
  1703.  
  1704.       if (W_59->Pattern->U_1.V_49.Pattern.Tempo != Idents_NoIdent && W_59->Pattern->U_1.V_1.Kind != Tree_DontCare1) {
  1705.         IO_WriteS(Tree_f, (STRING)"  ", 2L);
  1706.         Tree_WI(W_59->Pattern->U_1.V_49.Pattern.Tempo);
  1707.         IO_WriteS(Tree_f, (STRING)": ", 2L);
  1708.         Mod_DefMod(W_59->Pattern->U_1.V_49.Pattern.TypeDesc);
  1709.         IO_WriteS(Tree_f, (STRING)";", 1L);
  1710.         IO_WriteNl(Tree_f);
  1711.       }
  1712.       Declare(W_59->Pattern);
  1713.       Declare(W_59->Next);
  1714.       return;
  1715.     }
  1716.     break;
  1717.   case Tree_OneExpr:;
  1718.   case Tree_NamedExpr:;
  1719.     {
  1720.       register Tree_yOneExpr *W_60 = &t->U_1.V_58.OneExpr;
  1721.  
  1722.       Declare(W_60->Expr);
  1723.       Declare(W_60->Next);
  1724.       return;
  1725.     }
  1726.     break;
  1727.   case Tree_Decompose:;
  1728.     {
  1729.       register Tree_yDecompose *W_61 = &t->U_1.V_50.Decompose;
  1730.  
  1731.       Declare(W_61->Patterns);
  1732.       return;
  1733.     }
  1734.     break;
  1735.   case Tree_DontCare:;
  1736.     {
  1737.       register Tree_yDontCare *W_62 = &t->U_1.V_54.DontCare;
  1738.  
  1739.       Declare(W_62->Tempos);
  1740.       return;
  1741.     }
  1742.     break;
  1743.   case Tree_DontCare1:;
  1744.     {
  1745.       register Tree_yDontCare1 *W_63 = &t->U_1.V_53.DontCare1;
  1746.  
  1747.       if (W_63->Tempo != Idents_NoIdent) {
  1748.         IO_WriteS(Tree_f, (STRING)"  ", 2L);
  1749.         Tree_WI(W_63->Tempo);
  1750.         IO_WriteS(Tree_f, (STRING)": ", 2L);
  1751.         Mod_DefMod(W_63->TypeDesc);
  1752.         IO_WriteS(Tree_f, (STRING)";", 1L);
  1753.         IO_WriteNl(Tree_f);
  1754.       }
  1755.       return;
  1756.     }
  1757.     break;
  1758.   case Tree_Value:;
  1759.     {
  1760.       register Tree_yValue *W_64 = &t->U_1.V_55.Value;
  1761.  
  1762.       Declare(W_64->Expr);
  1763.       return;
  1764.     }
  1765.     break;
  1766.   case Tree_Compose:;
  1767.     {
  1768.       register Tree_yCompose *W_65 = &t->U_1.V_61.Compose;
  1769.  
  1770.       if (W_65->Tempo != Idents_NoIdent) {
  1771.         IO_WriteS(Tree_f, (STRING)"  ", 2L);
  1772.         Tree_WI(W_65->Tempo);
  1773.         IO_WriteS(Tree_f, (STRING)": ", 2L);
  1774.         Mod_DefMod(W_65->TypeDesc);
  1775.         IO_WriteS(Tree_f, (STRING)";", 1L);
  1776.         IO_WriteNl(Tree_f);
  1777.       }
  1778.       Declare(W_65->Exprs);
  1779.       return;
  1780.     }
  1781.     break;
  1782.   case Tree_Call:;
  1783.     {
  1784.       register Tree_yCall *W_66 = &t->U_1.V_65.Call;
  1785.  
  1786.       Declare(W_66->Expr);
  1787.       Declare(W_66->Exprs);
  1788.       Declare(W_66->Patterns);
  1789.       return;
  1790.     }
  1791.     break;
  1792.   case Tree_Binary:;
  1793.     {
  1794.       register Tree_yBinary *W_67 = &t->U_1.V_66.Binary;
  1795.  
  1796.       Declare(W_67->Lop);
  1797.       Declare(W_67->Rop);
  1798.       return;
  1799.     }
  1800.     break;
  1801.   case Tree_PreOperator:;
  1802.     {
  1803.       register Tree_yPreOperator *W_68 = &t->U_1.V_67.PreOperator;
  1804.  
  1805.       Declare(W_68->Expr);
  1806.       return;
  1807.     }
  1808.     break;
  1809.   case Tree_PostOperator:;
  1810.     {
  1811.       register Tree_yPostOperator *W_69 = &t->U_1.V_68.PostOperator;
  1812.  
  1813.       Declare(W_69->Expr);
  1814.       return;
  1815.     }
  1816.     break;
  1817.   case Tree_Parents:;
  1818.     {
  1819.       register Tree_yParents *W_70 = &t->U_1.V_70.Parents;
  1820.  
  1821.       Declare(W_70->Expr);
  1822.       return;
  1823.     }
  1824.     break;
  1825.   case Tree_Index:;
  1826.     {
  1827.       register Tree_yIndex *W_71 = &t->U_1.V_69.Index;
  1828.  
  1829.       Declare(W_71->Expr);
  1830.       Declare(W_71->Exprs);
  1831.       return;
  1832.     }
  1833.     break;
  1834.   default :
  1835.     break;
  1836.   }
  1837. }
  1838.  
  1839. static void Tg1
  1840. # ifdef __STDC__
  1841. (Tree_tTree t)
  1842. # else
  1843. (t)
  1844. Tree_tTree t;
  1845. # endif
  1846. {
  1847.   struct S_9 yyTempo;
  1848.  
  1849.   if (t == Tree_NoTree) {
  1850.     return;
  1851.   }
  1852.   if (t->U_1.V_1.Kind == Tree_Formal) {
  1853.     {
  1854.       register Tree_yFormal *W_72 = &t->U_1.V_86.Formal;
  1855.  
  1856.       TheName = W_72->Name;
  1857.       Tg1(W_72->TypeDesc);
  1858.       Tg1(W_72->Next);
  1859.       return;
  1860.     }
  1861.   }
  1862.   if (t->U_1.V_1.Kind == Tree_NodeTypes) {
  1863.     {
  1864.       register Tree_yNodeTypes *W_73 = &t->U_1.V_89.NodeTypes;
  1865.  
  1866.       IO_WriteS(Tree_f, (STRING)"  IF ", 5L);
  1867.       Tree_WI(TheName);
  1868.       IO_WriteS(Tree_f, (STRING)" = ", 3L);
  1869.       Tree_WI(W_73->TreeName->U_1.V_29.TreeName.Name);
  1870.       IO_WriteS(Tree_f, (STRING)".No", 3L);
  1871.       Tree_WI(W_73->TreeName->U_1.V_29.TreeName.Name);
  1872.       IO_WriteS(Tree_f, (STRING)" THEN RETURN", 12L);
  1873.       if (RoutineKind == kPredicate) {
  1874.         IO_WriteS(Tree_f, (STRING)" FALSE", 6L);
  1875.       }
  1876.       IO_WriteS(Tree_f, (STRING)"; END;", 6L);
  1877.       IO_WriteNl(Tree_f);
  1878.       return;
  1879.     }
  1880.   }
  1881. }
  1882.  
  1883. static void Tg3
  1884. # ifdef __STDC__
  1885. (Tree_tTree t)
  1886. # else
  1887. (t)
  1888. Tree_tTree t;
  1889. # endif
  1890. {
  1891.   struct S_10 yyTempo;
  1892.  
  1893.   if (t == Tree_NoTree) {
  1894.     return;
  1895.   }
  1896.   if (t->U_1.V_1.Kind == Tree_OnePattern) {
  1897.     {
  1898.       register Tree_yOnePattern *W_74 = &t->U_1.V_45.OnePattern;
  1899.  
  1900.       Tg3(W_74->Pattern);
  1901.       Tg3(W_74->Next);
  1902.       return;
  1903.     }
  1904.   }
  1905.   if (t->U_1.V_1.Kind == Tree_Decompose) {
  1906.     {
  1907.       register Tree_yDecompose *W_75 = &t->U_1.V_50.Decompose;
  1908.  
  1909.       IO_WriteS(Tree_f, (STRING)"     END;", 9L);
  1910.       IO_WriteNl(Tree_f);
  1911.       return;
  1912.     }
  1913.   }
  1914. }
  1915.  
  1916. static void CommonTestElim2
  1917. # ifdef __STDC__
  1918. (Tree_tTree OneTest, Tree_tTree yyP1)
  1919. # else
  1920. (OneTest, yyP1)
  1921. Tree_tTree OneTest;
  1922. Tree_tTree yyP1;
  1923. # endif
  1924. {
  1925.   struct S_11 yyTempo;
  1926.  
  1927.   if (OneTest == Tree_NoTree) {
  1928.     return;
  1929.   }
  1930.   if (yyP1 == Tree_NoTree) {
  1931.     return;
  1932.   }
  1933.   if (OneTest->U_1.V_1.Kind == Tree_TestValue) {
  1934.     for (;;) {
  1935.       {
  1936.         register Tree_yTestValue *W_76 = &OneTest->U_1.V_102.TestValue;
  1937.  
  1938.         if (!Optimize_NeedsMatch(W_76->Expr)) {
  1939.           goto EXIT_1;
  1940.         }
  1941.         CommonTestElim(OneTest);
  1942.         IO_WriteS(Tree_f, (STRING)"    LOOP", 8L);
  1943.         IO_WriteNl(Tree_f);
  1944.         MatchExpr(OneTest->U_1.V_102.TestValue.Expr);
  1945.         CommonTestElim(yyP1);
  1946.         IO_WriteS(Tree_f, (STRING)"    EXIT; END;", 14L);
  1947.         IO_WriteNl(Tree_f);
  1948.         return;
  1949.       }
  1950.     } EXIT_1:;
  1951.   }
  1952.   CommonTestElim(OneTest);
  1953.   CommonTestElim(yyP1);
  1954.   return;
  1955. }
  1956.  
  1957. static void CommonTestElim
  1958. # ifdef __STDC__
  1959. (Tree_tTree t)
  1960. # else
  1961. (t)
  1962. Tree_tTree t;
  1963. # endif
  1964. {
  1965.   struct S_12 yyTempo;
  1966.  
  1967.   if (t == Tree_NoTree) {
  1968.     return;
  1969.   }
  1970.   switch (t->U_1.V_1.Kind) {
  1971.   case Tree_Decision:;
  1972.     {
  1973.       register Tree_yDecision *W_77 = &t->U_1.V_105.Decision;
  1974.  
  1975.       if (W_77->Cases == 0) {
  1976.         if (!TemposDone && W_77->OneTest->U_1.V_1.Kind == Tree_TestValue && Optimize_NeedsTempo(W_77->Then, &rule)) {
  1977.           IO_WriteS(Tree_f, (STRING)"    WITH yyTempo.yyR", 20L);
  1978.           Tree_WN((LONGINT)rule->U_1.V_42.Rule.Index);
  1979.           IO_WriteS(Tree_f, (STRING)" DO", 3L);
  1980.           IO_WriteNl(Tree_f);
  1981.           TemposDone = TRUE;
  1982.           CommonTestElim2(W_77->OneTest, W_77->Then);
  1983.           IO_WriteS(Tree_f, (STRING)"  END;", 6L);
  1984.           IO_WriteNl(Tree_f);
  1985.           IO_WriteS(Tree_f, (STRING)"    END;", 8L);
  1986.           IO_WriteNl(Tree_f);
  1987.         } else {
  1988.           Optimize_GetRule(W_77->Then, &rule);
  1989.           Decls = rule->U_1.V_42.Rule.VarDecls;
  1990.           CommonTestElim2(W_77->OneTest, W_77->Then);
  1991.           IO_WriteS(Tree_f, (STRING)"  END;", 6L);
  1992.           IO_WriteNl(Tree_f);
  1993.         }
  1994.         TemposDone = FALSE;
  1995.         CommonTestElim(W_77->Else);
  1996.       } else {
  1997.         i = W_77->Cases;
  1998.         Case(t);
  1999.       }
  2000.       return;
  2001.     }
  2002.     break;
  2003.   case Tree_Decided:;
  2004.     {
  2005.       register Tree_yDecided *W_78 = &t->U_1.V_106.Decided;
  2006.  
  2007.       CommonTestElim(W_78->Rule);
  2008.       if (W_78->Rule->U_1.V_42.Rule.HasExit) {
  2009.         TemposDone = FALSE;
  2010.         CommonTestElim(W_78->Else);
  2011.       }
  2012.       return;
  2013.     }
  2014.     break;
  2015.   case Tree_TestKind:;
  2016.     {
  2017.       register Tree_yTestKind *W_79 = &t->U_1.V_98.TestKind;
  2018.  
  2019.       IO_WriteS(Tree_f, (STRING)"  IF (", 6L);
  2020.       Mod_ImplMod(W_79->Path);
  2021.       IO_WriteS(Tree_f, (STRING)"^.Kind = ", 9L);
  2022.       Tree_WI(W_79->TypeDesc->U_1.V_89.NodeTypes.TreeName->U_1.V_29.TreeName.Name);
  2023.       IO_WriteS(Tree_f, (STRING)".", 1L);
  2024.       Tree_WI(W_79->Name);
  2025.       IO_WriteS(Tree_f, (STRING)") THEN", 6L);
  2026.       IO_WriteNl(Tree_f);
  2027.       return;
  2028.     }
  2029.     break;
  2030.   case Tree_TestIsType:;
  2031.     {
  2032.       register Tree_yTestIsType *W_80 = &t->U_1.V_99.TestIsType;
  2033.  
  2034.       IO_WriteS(Tree_f, (STRING)"  IF ", 5L);
  2035.       Tree_WI(W_80->TypeDesc->U_1.V_89.NodeTypes.TreeName->U_1.V_29.TreeName.Name);
  2036.       IO_WriteS(Tree_f, (STRING)".IsType (", 9L);
  2037.       Mod_ImplMod(W_80->Path);
  2038.       IO_WriteS(Tree_f, (STRING)", ", 2L);
  2039.       Tree_WI(W_80->TypeDesc->U_1.V_89.NodeTypes.TreeName->U_1.V_29.TreeName.Name);
  2040.       IO_WriteS(Tree_f, (STRING)".", 1L);
  2041.       Tree_WI(W_80->Name);
  2042.       IO_WriteS(Tree_f, (STRING)") THEN", 6L);
  2043.       IO_WriteNl(Tree_f);
  2044.       return;
  2045.     }
  2046.     break;
  2047.   case Tree_TestNil:;
  2048.     {
  2049.       register Tree_yTestNil *W_81 = &t->U_1.V_100.TestNil;
  2050.  
  2051.       IO_WriteS(Tree_f, (STRING)"  IF ", 5L);
  2052.       Mod_ImplMod(W_81->Path);
  2053.       IO_WriteS(Tree_f, (STRING)" = NIL THEN", 11L);
  2054.       IO_WriteNl(Tree_f);
  2055.       return;
  2056.     }
  2057.     break;
  2058.   case Tree_TestNonlin:;
  2059.     {
  2060.       register Tree_yTestNonlin *W_82 = &t->U_1.V_101.TestNonlin;
  2061.  
  2062.       IO_WriteS(Tree_f, (STRING)"  IF (equal", 11L);
  2063.       Mod_ImplMod(W_82->TypeDesc);
  2064.       IO_WriteS(Tree_f, (STRING)" (", 2L);
  2065.       Mod_ImplMod(W_82->Path);
  2066.       IO_WriteS(Tree_f, (STRING)", ", 2L);
  2067.       Mod_ImplMod(W_82->Path2);
  2068.       IO_WriteS(Tree_f, (STRING)")) THEN", 7L);
  2069.       IO_WriteNl(Tree_f);
  2070.       return;
  2071.     }
  2072.     break;
  2073.   case Tree_TestValue:;
  2074.     {
  2075.       register Tree_yTestValue *W_83 = &t->U_1.V_102.TestValue;
  2076.  
  2077.       AssignTempo(W_83->Expr);
  2078.       IO_WriteS(Tree_f, (STRING)"  IF (equal", 11L);
  2079.       Mod_ImplMod(W_83->TypeDesc);
  2080.       IO_WriteS(Tree_f, (STRING)" (", 2L);
  2081.       Mod_ImplMod(W_83->Path);
  2082.       IO_WriteS(Tree_f, (STRING)", ", 2L);
  2083.       Expression(W_83->Expr);
  2084.       IO_WriteS(Tree_f, (STRING)")) THEN", 7L);
  2085.       IO_WriteNl(Tree_f);
  2086.       return;
  2087.     }
  2088.     break;
  2089.   case Tree_Rule:;
  2090.     {
  2091.       register Tree_yRule *W_84 = &t->U_1.V_42.Rule;
  2092.  
  2093.       WriteLine(W_84->Line);
  2094.       if (W_84->HasTempos && !TemposDone) {
  2095.         IO_WriteS(Tree_f, (STRING)"    WITH yyTempo.yyR", 20L);
  2096.         Tree_WN((LONGINT)W_84->Index);
  2097.         IO_WriteS(Tree_f, (STRING)" DO", 3L);
  2098.         IO_WriteNl(Tree_f);
  2099.       }
  2100.       if (W_84->HasExit) {
  2101.         IO_WriteS(Tree_f, (STRING)"   LOOP", 7L);
  2102.         IO_WriteNl(Tree_f);
  2103.       }
  2104.       Decls = W_84->VarDecls;
  2105.       if (Sets_IsElement(ORD('w'), &Tree_Options) && W_84->Statements->U_1.V_1.Kind != Tree_NoStatement) {
  2106.         Tg2(W_84->Patterns, InFormals);
  2107.       }
  2108.       Mod_ImplMod(W_84->Statements);
  2109.       if (!W_84->HasRejectOrFail) {
  2110.         AssignFormals(W_84->Exprs, OutFormals);
  2111.         MatchExprs(W_84->Exprs);
  2112.         switch (RoutineKind) {
  2113.         case kProcedure:;
  2114.           IO_WriteS(Tree_f, (STRING)"      RETURN;", 13L);
  2115.           IO_WriteNl(Tree_f);
  2116.           break;
  2117.         case kFunction:;
  2118.           AssignTempo(W_84->Expr);
  2119.           if (W_84->HasPatterns && W_84->Expr->U_1.V_1.Kind != Tree_Compose && t->U_1.V_1.Kind != Tree_DontCare1) {
  2120.             IO_WriteS(Tree_f, (STRING)"      ", 6L);
  2121.             Tree_WI(W_84->Tempo);
  2122.             IO_WriteS(Tree_f, (STRING)" := ", 4L);
  2123.             Expression(W_84->Expr);
  2124.             IO_WriteS(Tree_f, (STRING)";", 1L);
  2125.             IO_WriteNl(Tree_f);
  2126.             MatchExpr(W_84->Expr);
  2127.             IO_WriteS(Tree_f, (STRING)"      RETURN ", 13L);
  2128.             Tree_WI(W_84->Tempo);
  2129.             IO_WriteS(Tree_f, (STRING)";", 1L);
  2130.             IO_WriteNl(Tree_f);
  2131.           } else {
  2132.             MatchExpr(W_84->Expr);
  2133.             IO_WriteS(Tree_f, (STRING)"      RETURN ", 13L);
  2134.             Expression(W_84->Expr);
  2135.             IO_WriteS(Tree_f, (STRING)";", 1L);
  2136.             IO_WriteNl(Tree_f);
  2137.           }
  2138.           break;
  2139.         case kPredicate:;
  2140.           IO_WriteS(Tree_f, (STRING)"      RETURN TRUE;", 18L);
  2141.           IO_WriteNl(Tree_f);
  2142.           break;
  2143.         }
  2144.       }
  2145.       if (Sets_IsElement(ORD('w'), &Tree_Options) && W_84->Statements->U_1.V_1.Kind != Tree_NoStatement) {
  2146.         Tg3(W_84->Patterns);
  2147.       }
  2148.       if (W_84->HasExit) {
  2149.         IO_WriteS(Tree_f, (STRING)"   END;", 7L);
  2150.         IO_WriteNl(Tree_f);
  2151.       }
  2152.       if (W_84->HasTempos && !TemposDone) {
  2153.         IO_WriteS(Tree_f, (STRING)"    END;", 8L);
  2154.         IO_WriteNl(Tree_f);
  2155.       }
  2156.       IO_WriteNl(Tree_f);
  2157.       return;
  2158.     }
  2159.     break;
  2160.   default :
  2161.     break;
  2162.   }
  2163. }
  2164.  
  2165. static void Case
  2166. # ifdef __STDC__
  2167. (Tree_tTree t)
  2168. # else
  2169. (t)
  2170. Tree_tTree t;
  2171. # endif
  2172. {
  2173.   struct S_13 yyTempo;
  2174.  
  2175.   if (t == Tree_NoTree) {
  2176.     return;
  2177.   }
  2178.   if (t->U_1.V_1.Kind == Tree_Decision) {
  2179.     {
  2180.       register struct S_14 *W_85 = &yyTempo.U_1.V_1.yyR1;
  2181.  
  2182.       {
  2183.         register Tree_yDecision *W_86 = &t->U_1.V_105.Decision;
  2184.  
  2185.         IO_WriteNl(Tree_f);
  2186.         IO_WriteS(Tree_f, (STRING)"  CASE ", 7L);
  2187.         Mod_ImplMod(W_86->OneTest->U_1.V_97.OneTest.Path);
  2188.         IO_WriteS(Tree_f, (STRING)"^.Kind OF", 9L);
  2189.         IO_WriteNl(Tree_f);
  2190.         W_85->n = i;
  2191.         while (W_85->n > 0) {
  2192.           if (!Sets_IsEmpty(t->U_1.V_105.Decision.OneTest->U_1.V_99.TestIsType.TypeDesc->U_1.V_89.NodeTypes.Types)) {
  2193.             Case(t->U_1.V_105.Decision.OneTest);
  2194.             CommonTestElim(t->U_1.V_105.Decision.Then);
  2195.           }
  2196.           t = t->U_1.V_105.Decision.Else;
  2197.           DEC(W_85->n);
  2198.         }
  2199.         IO_WriteS(Tree_f, (STRING)"  ELSE END;", 11L);
  2200.         IO_WriteNl(Tree_f);
  2201.         IO_WriteNl(Tree_f);
  2202.         CommonTestElim(t);
  2203.         return;
  2204.       }
  2205.     }
  2206.   }
  2207.   if (t->U_1.V_1.Kind == Tree_TestKind) {
  2208.     {
  2209.       register Tree_yTestKind *W_87 = &t->U_1.V_98.TestKind;
  2210.  
  2211.       IO_WriteS(Tree_f, (STRING)"  | ", 4L);
  2212.       Tree_WI(W_87->TypeDesc->U_1.V_89.NodeTypes.TreeName->U_1.V_29.TreeName.Name);
  2213.       IO_WriteS(Tree_f, (STRING)".", 1L);
  2214.       Tree_WI(W_87->Name);
  2215.       IO_WriteS(Tree_f, (STRING)":", 1L);
  2216.       IO_WriteNl(Tree_f);
  2217.       return;
  2218.     }
  2219.   }
  2220.   if (t->U_1.V_1.Kind == Tree_TestIsType) {
  2221.     {
  2222.       register Tree_yTestIsType *W_88 = &t->U_1.V_99.TestIsType;
  2223.  
  2224.       {
  2225.         register Tree_yNodeTypes *W_89 = &W_88->TypeDesc->U_1.V_89.NodeTypes;
  2226.  
  2227.         TheClass = Semantics_LookupClass(W_89->TreeName->U_1.V_29.TreeName.Classes, Sets_Minimum(&W_89->Types));
  2228.         IO_WriteS(Tree_f, (STRING)"  | ", 4L);
  2229.         Tree_WI(W_89->TreeName->U_1.V_29.TreeName.Name);
  2230.         IO_WriteS(Tree_f, (STRING)".", 1L);
  2231.         Tree_WI(TheClass->U_1.V_5.Class.Name);
  2232.         Case(W_88->TypeDesc);
  2233.         IO_WriteS(Tree_f, (STRING)":", 1L);
  2234.         IO_WriteNl(Tree_f);
  2235.       }
  2236.       return;
  2237.     }
  2238.   }
  2239.   if (t->U_1.V_1.Kind == Tree_NodeTypes) {
  2240.     {
  2241.       register Tree_yNodeTypes *W_90 = &t->U_1.V_89.NodeTypes;
  2242.  
  2243.       {
  2244.         LONGCARD B_3 = Sets_Minimum(&W_90->Types) + 1, B_4 = Sets_Maximum(&W_90->Types);
  2245.  
  2246.         if (B_3 <= B_4)
  2247.           for (j = B_3;; j += 1) {
  2248.             if (Sets_IsElement(j, &W_90->Types)) {
  2249.               TheClass = Semantics_LookupClass(W_90->TreeName->U_1.V_29.TreeName.Classes, j);
  2250.               IO_WriteNl(Tree_f);
  2251.               IO_WriteS(Tree_f, (STRING)"  , ", 4L);
  2252.               Tree_WI(W_90->TreeName->U_1.V_29.TreeName.Name);
  2253.               IO_WriteS(Tree_f, (STRING)".", 1L);
  2254.               Tree_WI(TheClass->U_1.V_5.Class.Name);
  2255.             }
  2256.             if (j >= B_4) break;
  2257.           }
  2258.       }
  2259.       return;
  2260.     }
  2261.   }
  2262. }
  2263.  
  2264. void Mod_BeginMod
  2265. # ifdef __STDC__
  2266. ()
  2267. # else
  2268. ()
  2269. # endif
  2270. {
  2271. }
  2272.  
  2273. void Mod_CloseMod
  2274. # ifdef __STDC__
  2275. ()
  2276. # else
  2277. ()
  2278. # endif
  2279. {
  2280. }
  2281.  
  2282. static void yyExit
  2283. # ifdef __STDC__
  2284. ()
  2285. # else
  2286. ()
  2287. # endif
  2288. {
  2289.   IO_CloseIO();
  2290.   Exit(1L);
  2291. }
  2292.  
  2293. void BEGIN_Mod()
  2294. {
  2295.   static BOOLEAN has_been_called = FALSE;
  2296.  
  2297.   if (!has_been_called) {
  2298.     has_been_called = TRUE;
  2299.  
  2300.     BEGIN_IO();
  2301.     BEGIN_Tree();
  2302.     BEGIN_System();
  2303.     BEGIN_IO();
  2304.     BEGIN_Tree();
  2305.     BEGIN_Positions();
  2306.     BEGIN_IO();
  2307.     BEGIN_StringMem();
  2308.     BEGIN_Idents();
  2309.     BEGIN_Texts();
  2310.     BEGIN_Sets();
  2311.     BEGIN_Semantics();
  2312.     BEGIN_Optimize();
  2313.     BEGIN_Tree();
  2314.  
  2315.     Mod_yyf = IO_StdOutput;
  2316.     Mod_Exit = yyExit;
  2317.     Mod_BeginMod();
  2318.   }
  2319. }
  2320.